diff options
author | Wim <wim@42.be> | 2017-11-21 23:48:39 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-11-21 23:48:39 +0100 |
commit | 71cb9b2d1dd96b309134187cd38155c22f086060 (patch) | |
tree | 2cc3f7404e0f51e4aaab37d536acefcc4a805868 /vendor/github.com/matrix-org/gomatrix/sync.go | |
parent | cd4c9b194fe486bcea08c1b9166e1ac22508ab00 (diff) | |
download | matterbridge-msglm-71cb9b2d1dd96b309134187cd38155c22f086060.tar.gz matterbridge-msglm-71cb9b2d1dd96b309134187cd38155c22f086060.tar.bz2 matterbridge-msglm-71cb9b2d1dd96b309134187cd38155c22f086060.zip |
Update vendor github.com/matrix-org/gomatrix
Diffstat (limited to 'vendor/github.com/matrix-org/gomatrix/sync.go')
-rw-r--r-- | vendor/github.com/matrix-org/gomatrix/sync.go | 12 |
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 { |