diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-04-24 17:12:08 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-04-24 17:12:08 +0300 |
commit | 28c65275440b3f7371540b49733db8b6b170a64d (patch) | |
tree | 20b21f32e78c0ac301cb7e3f747c252fcb6ea02a /matrix/sync.go | |
parent | e64df67ec397795b8c6ebd06b391d953afe5a766 (diff) |
Fix/break/change things
Diffstat (limited to 'matrix/sync.go')
-rw-r--r-- | matrix/sync.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/matrix/sync.go b/matrix/sync.go index d0e1e69..8ad7ad5 100644 --- a/matrix/sync.go +++ b/matrix/sync.go @@ -28,7 +28,6 @@ import ( type SyncerSession interface { GetRoom(id string) *rooms.Room - SetInitialSyncDone() GetUserID() string } @@ -36,9 +35,10 @@ type SyncerSession interface { // replace parts of this default syncer (e.g. the ProcessResponse method). The default syncer uses the observer // pattern to notify callers about incoming events. See GomuksSyncer.OnEventType for more information. type GomuksSyncer struct { - Session SyncerSession - listeners map[string][]gomatrix.OnEventListener // event type to listeners array - FirstSyncDone bool + Session SyncerSession + listeners map[string][]gomatrix.OnEventListener // event type to listeners array + FirstSyncDone bool + InitDoneCallback func() } // NewGomuksSyncer returns an instantiated GomuksSyncer @@ -81,8 +81,8 @@ func (s *GomuksSyncer) ProcessResponse(res *gomatrix.RespSync, since string) (er } } - if since == "" { - s.Session.SetInitialSyncDone() + if since == "" && s.InitDoneCallback != nil { + s.InitDoneCallback() } s.FirstSyncDone = true |