mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 18:13:09 -06:00
Use UserID in appservice
This commit is contained in:
parent
b479b062c5
commit
222b67bfeb
|
|
@ -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
|
// 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 {
|
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 {
|
switch {
|
||||||
case appservice.URL == "":
|
case appservice.URL == "":
|
||||||
return false
|
return false
|
||||||
case appservice.IsInterestedInUserID(event.SenderID()):
|
case appservice.IsInterestedInUserID(user):
|
||||||
return true
|
return true
|
||||||
case appservice.IsInterestedInRoomID(event.RoomID()):
|
case appservice.IsInterestedInRoomID(event.RoomID()):
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue