aboutsummaryrefslogtreecommitdiff
path: root/syncapi/types/provider.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/types/provider.go')
-rw-r--r--syncapi/types/provider.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/syncapi/types/provider.go b/syncapi/types/provider.go
index e6777f64..a9ea234d 100644
--- a/syncapi/types/provider.go
+++ b/syncapi/types/provider.go
@@ -25,6 +25,23 @@ type SyncRequest struct {
IgnoredUsers IgnoredUsers
}
+func (r *SyncRequest) IsRoomPresent(roomID string) bool {
+ membership, ok := r.Rooms[roomID]
+ if !ok {
+ return false
+ }
+ switch membership {
+ case gomatrixserverlib.Join:
+ return true
+ case gomatrixserverlib.Invite:
+ return true
+ case gomatrixserverlib.Peek:
+ return true
+ default:
+ return false
+ }
+}
+
type StreamProvider interface {
Setup()