diff --git a/src/github.com/matrix-org/dendrite/common/config/appservice.go b/src/github.com/matrix-org/dendrite/common/config/appservice.go index 56b01611..73927b0d 100644 --- a/src/github.com/matrix-org/dendrite/common/config/appservice.go +++ b/src/github.com/matrix-org/dendrite/common/config/appservice.go @@ -21,6 +21,7 @@ import ( "regexp" "strings" + roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" yaml "gopkg.in/yaml.v2" ) @@ -69,6 +70,20 @@ func (a *ApplicationService) IsInterestedInRoomID( return false } +// IsInterestedInRoom checks to see if an application service is interested in a +// room by seeing if any of the virtual users owned by the appservice is in the +// room. +func (a *ApplicationService) IsInterestedInRoom( + roomID string, rsAPI *roomserverAPI, +) bool { + queryReq := rsAPI.QueryMembershipsForRoomRequest{ + JoinedOnly: true, + RoomID: roomID, + Sender: + } + rsAPI.Query +} + // IsInterestedInUserID returns a bool on whether an application service's // namespace includes the given user ID func (a *ApplicationService) IsInterestedInUserID(