From 24b3e1a21793dbce7dded5c48e928bd94f32496e Mon Sep 17 00:00:00 2001 From: Alex Chen Date: Fri, 12 Jul 2019 22:26:35 +0800 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- syncapi/sync/notifier.go | 8 ++++---- typingserver/cache/cache.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/syncapi/sync/notifier.go b/syncapi/sync/notifier.go index 9f6371e03..30ac3a2e5 100644 --- a/syncapi/sync/notifier.go +++ b/syncapi/sync/notifier.go @@ -61,11 +61,11 @@ func NewNotifier(pos types.SyncPosition) *Notifier { // current sync position incorrectly. // Chooses which user sync streams to update by a provided *gomatrixserverlib.Event // (based on the users in the event's room), -// a roomID directly, or a list of user IDs, whichever specified first in the parameters. +// a roomID directly, or a list of user IDs, prioritised by parameter ordering. // posUpdate contains the latest position(s) for one or more types of events. -// If a position in posUpdate is 0, it means no updates available of that type. -// Typically a consumer supplies a posUpdate with the sync position for the -// event type it handles set to the latest, leaving other fields as 0. +// If a position in posUpdate is 0, it means no updates are available of that type. +// Typically a consumer supplies a posUpdate with the latest sync position for the +// event type it handles, leaving other fields as 0. func (n *Notifier) OnNewEvent( ev *gomatrixserverlib.Event, roomID string, userIDs []string, posUpdate types.SyncPosition, diff --git a/typingserver/cache/cache.go b/typingserver/cache/cache.go index 2571e7427..8d84f856c 100644 --- a/typingserver/cache/cache.go +++ b/typingserver/cache/cache.go @@ -22,7 +22,7 @@ const defaultTypingTimeout = 10 * time.Second // userSet is a map of user IDs to a timer, timer fires at expiry. type userSet map[string]*time.Timer -// TimeoutCallbackFn is a function called right after removal of a user +// TimeoutCallbackFn is a function called right after the removal of a user // from the typing user list due to timeout. // latestSyncPosition is the typing sync position after the removal. type TimeoutCallbackFn func(userID, roomID string, latestSyncPosition int64)