aboutsummaryrefslogtreecommitdiff
path: root/syncapi/consumers/eduserver_typing.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-12-10 18:57:10 +0000
committerGitHub <noreply@github.com>2020-12-10 18:57:10 +0000
commit9c03b0a4fa38971dfe83bd135aefb3c482a18380 (patch)
treeba8e55b75c056adac1fc7c42fb6febb2b8565d36 /syncapi/consumers/eduserver_typing.go
parentbad81c028f090af0e1005076829db67d1a749a14 (diff)
Refactor sync tokens (#1628)
* Refactor sync tokens * Comment out broken notifier test * Update types, sytest-whitelist * More robust token checking * Remove New functions for streaming tokens * Export Logs in StreamingToken * Fix tests
Diffstat (limited to 'syncapi/consumers/eduserver_typing.go')
-rw-r--r--syncapi/consumers/eduserver_typing.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/syncapi/consumers/eduserver_typing.go b/syncapi/consumers/eduserver_typing.go
index bdea606c..885e7fd1 100644
--- a/syncapi/consumers/eduserver_typing.go
+++ b/syncapi/consumers/eduserver_typing.go
@@ -66,7 +66,9 @@ func (s *OutputTypingEventConsumer) Start() error {
s.db.SetTypingTimeoutCallback(func(userID, roomID string, latestSyncPosition int64) {
s.notifier.OnNewEvent(
nil, roomID, nil,
- types.NewStreamToken(0, types.StreamPosition(latestSyncPosition), nil),
+ types.StreamingToken{
+ TypingPosition: types.StreamPosition(latestSyncPosition),
+ },
)
})
@@ -95,6 +97,6 @@ func (s *OutputTypingEventConsumer) onMessage(msg *sarama.ConsumerMessage) error
typingPos = s.db.RemoveTypingUser(typingEvent.UserID, typingEvent.RoomID)
}
- s.notifier.OnNewEvent(nil, output.Event.RoomID, nil, types.NewStreamToken(0, typingPos, nil))
+ s.notifier.OnNewEvent(nil, output.Event.RoomID, nil, types.StreamingToken{TypingPosition: typingPos})
return nil
}