From 5db5cd550d71c9844f3abeb44d3a9bb7fd23ad80 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 3 Mar 2020 22:53:42 +0200 Subject: [PATCH] Properly ignore presence in sync filter --- matrix/sync.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/matrix/sync.go b/matrix/sync.go index 564848b..81c0596 100644 --- a/matrix/sync.go +++ b/matrix/sync.go @@ -186,7 +186,8 @@ func (s *GomuksSyncer) OnEventType(eventType mautrix.EventType, callback EventHa func (s *GomuksSyncer) notifyListeners(source EventSource, event *mautrix.Event) { if (event.Type.IsState() && source&EventSourceState == 0 && event.StateKey == nil) || (event.Type.IsAccountData() && source&EventSourceAccountData == 0) || - (event.Type.IsEphemeral() && source&EventSourceEphemeral == 0) { + (event.Type.IsEphemeral() && event.Type != mautrix.EphemeralEventPresence && source&EventSourceEphemeral == 0) || + (event.Type == mautrix.EphemeralEventPresence && source&EventSourcePresence == 0) { evtJson, _ := json.Marshal(event) debug.Printf("Event of type %s received from mismatching source %s: %s", event.Type.String(), source.String(), string(evtJson)) return @@ -253,7 +254,7 @@ func (s *GomuksSyncer) GetFilterJSON(userID string) json.RawMessage { Types: []string{"m.push_rules", "m.direct", "net.maunium.gomuks.preferences"}, }, Presence: mautrix.FilterPart{ - Types: []string{}, + NotTypes: []string{"*"}, }, } rawFilter, _ := json.Marshal(&filter)