mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-05 15:42:46 +00:00
PDU Sender split (#3100)
Initial cut of splitting PDU Sender into SenderID & looking up UserID where required.
This commit is contained in:
parent
725ff5567d
commit
7a1fd7f512
66 changed files with 580 additions and 189 deletions
|
@ -99,15 +99,18 @@ func MakeJoin(
|
|||
}
|
||||
|
||||
input := gomatrixserverlib.HandleMakeJoinInput{
|
||||
Context: httpReq.Context(),
|
||||
UserID: userID,
|
||||
RoomID: roomID,
|
||||
RoomVersion: roomVersion,
|
||||
RemoteVersions: remoteVersions,
|
||||
RequestOrigin: request.Origin(),
|
||||
LocalServerName: cfg.Matrix.ServerName,
|
||||
LocalServerInRoom: res.RoomExists && res.IsInRoom,
|
||||
RoomQuerier: &roomQuerier,
|
||||
Context: httpReq.Context(),
|
||||
UserID: userID,
|
||||
RoomID: roomID,
|
||||
RoomVersion: roomVersion,
|
||||
RemoteVersions: remoteVersions,
|
||||
RequestOrigin: request.Origin(),
|
||||
LocalServerName: cfg.Matrix.ServerName,
|
||||
LocalServerInRoom: res.RoomExists && res.IsInRoom,
|
||||
RoomQuerier: &roomQuerier,
|
||||
UserIDQuerier: func(roomID, senderID string) (*spec.UserID, error) {
|
||||
return rsAPI.QueryUserIDForSender(httpReq.Context(), roomID, senderID)
|
||||
},
|
||||
BuildEventTemplate: createJoinTemplate,
|
||||
}
|
||||
response, internalErr := gomatrixserverlib.HandleMakeJoin(input)
|
||||
|
@ -202,6 +205,9 @@ func SendJoin(
|
|||
PrivateKey: cfg.Matrix.PrivateKey,
|
||||
Verifier: keys,
|
||||
MembershipQuerier: &api.MembershipQuerier{Roomserver: rsAPI},
|
||||
UserIDQuerier: func(roomID, senderID string) (*spec.UserID, error) {
|
||||
return rsAPI.QueryUserIDForSender(httpReq.Context(), roomID, senderID)
|
||||
},
|
||||
}
|
||||
response, joinErr := gomatrixserverlib.HandleSendJoin(input)
|
||||
switch e := joinErr.(type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue