From e74bc522395b98ef577362e2636776d67c7975b1 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 14 Jun 2018 14:46:21 +0100 Subject: [PATCH] WIP Signed-off-by: Andrew Morgan --- .../dendrite/common/config/appservice.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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(