aboutsummaryrefslogtreecommitdiff
path: root/appservice
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-06-14 14:23:46 +0000
committerGitHub <noreply@github.com>2023-06-14 14:23:46 +0000
commite4665979bfbe006368d55189f074e456fe19b198 (patch)
treee909d694a022478d0dbe3cc58ee8a2dc289bc969 /appservice
parent7a2e325d1014d76188b47a011730a42443f3c174 (diff)
Merge SenderID & Per Room User Key work (#3109)
Diffstat (limited to 'appservice')
-rw-r--r--appservice/consumers/roomserver.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/appservice/consumers/roomserver.go b/appservice/consumers/roomserver.go
index ff124514..1877de37 100644
--- a/appservice/consumers/roomserver.go
+++ b/appservice/consumers/roomserver.go
@@ -181,7 +181,7 @@ func (s *OutputRoomEventConsumer) sendEvents(
// Create the transaction body.
transaction, err := json.Marshal(
ApplicationServiceTransaction{
- Events: synctypes.ToClientEvents(gomatrixserverlib.ToPDUs(events), synctypes.FormatAll, func(roomID string, senderID spec.SenderID) (*spec.UserID, error) {
+ Events: synctypes.ToClientEvents(gomatrixserverlib.ToPDUs(events), synctypes.FormatAll, func(roomID spec.RoomID, senderID spec.SenderID) (*spec.UserID, error) {
return s.rsAPI.QueryUserIDForSender(ctx, roomID, senderID)
}),
},
@@ -236,7 +236,11 @@ func (s *appserviceState) backoffAndPause(err error) error {
// TODO: This should be cached, see https://github.com/matrix-org/dendrite/issues/1682
func (s *OutputRoomEventConsumer) appserviceIsInterestedInEvent(ctx context.Context, event *types.HeaderedEvent, appservice *config.ApplicationService) bool {
user := ""
- userID, err := s.rsAPI.QueryUserIDForSender(ctx, event.RoomID(), event.SenderID())
+ validRoomID, err := spec.NewRoomID(event.RoomID())
+ if err != nil {
+ return false
+ }
+ userID, err := s.rsAPI.QueryUserIDForSender(ctx, *validRoomID, event.SenderID())
if err == nil {
user = userID.String()
}