summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/matrix-org/gomatrix/sync.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/matrix-org/gomatrix/sync.go')
-rw-r--r--vendor/github.com/matrix-org/gomatrix/sync.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/vendor/github.com/matrix-org/gomatrix/sync.go b/vendor/github.com/matrix-org/gomatrix/sync.go
index 347e5dcf..c4bea48c 100644
--- a/vendor/github.com/matrix-org/gomatrix/sync.go
+++ b/vendor/github.com/matrix-org/gomatrix/sync.go
@@ -73,6 +73,16 @@ func (s *DefaultSyncer) ProcessResponse(res *RespSync, since string) (err error)
s.notifyListeners(&event)
}
}
+ for roomID, roomData := range res.Rooms.Leave {
+ room := s.getOrCreateRoom(roomID)
+ for _, event := range roomData.Timeline.Events {
+ if event.StateKey != nil {
+ event.RoomID = roomID
+ room.UpdateState(&event)
+ s.notifyListeners(&event)
+ }
+ }
+ }
return
}
@@ -102,7 +112,7 @@ func (s *DefaultSyncer) shouldProcessResponse(resp *RespSync, since string) bool
for roomID, roomData := range resp.Rooms.Join {
for i := len(roomData.Timeline.Events) - 1; i >= 0; i-- {
e := roomData.Timeline.Events[i]
- if e.Type == "m.room.member" && e.StateKey == s.UserID {
+ if e.Type == "m.room.member" && e.StateKey != nil && *e.StateKey == s.UserID {
m := e.Content["membership"]
mship, ok := m.(string)
if !ok {