From 64c39d4e4d7d5eebf6b35516c2441f2d9a49ca5f Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Fri, 30 Aug 2019 20:59:34 +0200 Subject: [PATCH] support ephemeral events --- responses.go | 3 +++ sync.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/responses.go b/responses.go index 7a3a4ce..cc46d16 100644 --- a/responses.go +++ b/responses.go @@ -159,6 +159,9 @@ type RespSync struct { Limited bool `json:"limited"` PrevBatch string `json:"prev_batch"` } `json:"timeline"` + Ephemeral struct { + Events []Event `json:"events"` + } `json:"ephemeral"` } `json:"join"` Invite map[string]struct { State struct { diff --git a/sync.go b/sync.go index c4bea48..ac326c3 100644 --- a/sync.go +++ b/sync.go @@ -64,6 +64,10 @@ func (s *DefaultSyncer) ProcessResponse(res *RespSync, since string) (err error) event.RoomID = roomID s.notifyListeners(&event) } + for _, event := range roomData.Ephemeral.Events { + event.RoomID = roomID + s.notifyListeners(&event) + } } for roomID, roomData := range res.Rooms.Invite { room := s.getOrCreateRoom(roomID)