aboutsummaryrefslogtreecommitdiff
path: root/syncapi/sync
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-12-03 11:11:46 +0000
committerGitHub <noreply@github.com>2020-12-03 11:11:46 +0000
commitbe7d8595be0533207f8942b129c16f3844550712 (patch)
tree7203824174cbec3f2bf33b4f62bfe25083de1b97 /syncapi/sync
parent2b03d24358aeac14ba7c8c63e35012d6e91c1509 (diff)
Peeking updates (#1607)
* Add unpeek * Don't allow peeks into encrypted rooms * Fix send tests * Update consumers
Diffstat (limited to 'syncapi/sync')
-rw-r--r--syncapi/sync/notifier.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/syncapi/sync/notifier.go b/syncapi/sync/notifier.go
index daa3a1d8..1d8cd624 100644
--- a/syncapi/sync/notifier.go
+++ b/syncapi/sync/notifier.go
@@ -137,6 +137,18 @@ func (n *Notifier) OnNewPeek(
// by calling OnNewEvent.
}
+func (n *Notifier) OnRetirePeek(
+ roomID, userID, deviceID string,
+) {
+ n.streamLock.Lock()
+ defer n.streamLock.Unlock()
+
+ n.removePeekingDevice(roomID, userID, deviceID)
+
+ // we don't wake up devices here given the roomserver consumer will do this shortly afterwards
+ // by calling OnRetireEvent.
+}
+
func (n *Notifier) OnNewSendToDevice(
userID string, deviceIDs []string,
posUpdate types.StreamingToken,