mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Add MXIDMapping
for pseudoID rooms (#3112)
Add `MXIDMapping` on membership events when creating/joining rooms.
This commit is contained in:
parent
4722f12fab
commit
23cd7877a1
41 changed files with 593 additions and 177 deletions
|
@ -15,6 +15,7 @@
|
|||
package routing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
|
@ -107,6 +108,10 @@ func MakeJoin(
|
|||
}
|
||||
}
|
||||
|
||||
if senderID == "" {
|
||||
senderID = spec.SenderID(userID.String())
|
||||
}
|
||||
|
||||
input := gomatrixserverlib.HandleMakeJoinInput{
|
||||
Context: httpReq.Context(),
|
||||
UserID: userID,
|
||||
|
@ -218,6 +223,13 @@ func SendJoin(
|
|||
UserIDQuerier: func(roomID spec.RoomID, senderID spec.SenderID) (*spec.UserID, error) {
|
||||
return rsAPI.QueryUserIDForSender(httpReq.Context(), roomID, senderID)
|
||||
},
|
||||
StoreSenderIDFromPublicID: func(ctx context.Context, senderID spec.SenderID, userIDRaw string, roomID spec.RoomID) error {
|
||||
userID, userErr := spec.NewUserID(userIDRaw, true)
|
||||
if userErr != nil {
|
||||
return userErr
|
||||
}
|
||||
return rsAPI.StoreUserRoomPublicKey(ctx, senderID, *userID, roomID)
|
||||
},
|
||||
}
|
||||
response, joinErr := gomatrixserverlib.HandleSendJoin(input)
|
||||
switch e := joinErr.(type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue