diff --git a/src/github.com/matrix-org/dendrite/appservice/consumers/roomserver.go b/src/github.com/matrix-org/dendrite/appservice/consumers/roomserver.go index ac366913..b3584dfb 100644 --- a/src/github.com/matrix-org/dendrite/appservice/consumers/roomserver.go +++ b/src/github.com/matrix-org/dendrite/appservice/consumers/roomserver.go @@ -179,7 +179,12 @@ func (s *OutputRoomEventConsumer) filterRoomserverEvents( // appserviceIsInterestedInEvent returns a boolean depending on whether a given // event falls within one of a given application service's namespaces. func (s *OutputRoomEventConsumer) appserviceIsInterestedInEvent(ctx context.Context, event gomatrixserverlib.Event, appservice config.ApplicationService) bool { - // Check room_id and sender of the event + // No reason to queue events if they'll never be sent to the application + // service + if appservice.URL == "" { + return false + } + if appservice.IsInterestedInUserID(event.Sender()) || appservice.IsInterestedInRoomID(event.RoomID()) { return true diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go index 34d237d5..bfecec5d 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go @@ -337,8 +337,9 @@ func UsernameMatchesMultipleExclusiveNamespaces( ) bool { // Check namespaces and see if more than one match matchCount := 0 + userID := userutil.MakeUserID(username, cfg.Matrix.ServerName) for _, appservice := range cfg.Derived.ApplicationServices { - if appservice.IsInterestedInUserID(username) { + if appservice.IsInterestedInUserID(userID) { if matchCount++; matchCount > 1 { return true }