Use UserID in appservice

This commit is contained in:
Devon Hudson 2023-06-02 12:57:08 -06:00
parent b479b062c5
commit 222b67bfeb
No known key found for this signature in database
GPG key ID: CD06B18E77F6A628

View file

@ -233,10 +233,16 @@ 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 := event.UserID()
if err == nil {
user = userID.String()
}
switch {
case appservice.URL == "":
return false
case appservice.IsInterestedInUserID(event.SenderID()):
case appservice.IsInterestedInUserID(user):
return true
case appservice.IsInterestedInRoomID(event.RoomID()):
return true