diff --git a/src/github.com/matrix-org/dendrite/typingserver/cache/cache.go b/src/github.com/matrix-org/dendrite/typingserver/cache/cache.go index b1b9452a8..739f60a24 100644 --- a/src/github.com/matrix-org/dendrite/typingserver/cache/cache.go +++ b/src/github.com/matrix-org/dendrite/typingserver/cache/cache.go @@ -85,12 +85,12 @@ func (t *TypingCache) addUser(userID, roomID string, expiryTimer *time.Timer) { // This removes the user. func (t *TypingCache) timeoutCallback(userID, roomID string) func() { return func() { - t.removeUser(userID, roomID) + t.RemoveUser(userID, roomID) } } -// removeUser with mutex lock & stop the timer. -func (t *TypingCache) removeUser(userID, roomID string) { +// RemoveUser with mutex lock & stop the timer. +func (t *TypingCache) RemoveUser(userID, roomID string) { t.Lock() defer t.Unlock() diff --git a/src/github.com/matrix-org/dendrite/typingserver/cache/cache_test.go b/src/github.com/matrix-org/dendrite/typingserver/cache/cache_test.go index 92baebafb..7aa73e922 100644 --- a/src/github.com/matrix-org/dendrite/typingserver/cache/cache_test.go +++ b/src/github.com/matrix-org/dendrite/typingserver/cache/cache_test.go @@ -33,7 +33,7 @@ func TestTypingCache(t *testing.T) { testGetTypingUsers(t, tCache) }) - t.Run("removeUser", func(t *testing.T) { + t.Run("RemoveUser", func(t *testing.T) { testRemoveUser(t, tCache) }) } @@ -90,7 +90,7 @@ func testRemoveUser(t *testing.T, tCache *TypingCache) { } length := len(tt.userIDs) - tCache.removeUser(tt.userIDs[length-1], tt.roomID) + tCache.RemoveUser(tt.userIDs[length-1], tt.roomID) expLeftUsers := tt.userIDs[:length-1] if leftUsers := tCache.GetTypingUsers(tt.roomID); !test.UnsortedStringSliceEqual(leftUsers, expLeftUsers) { t.Errorf("Response after removal is unexpected. Want = %s, got = %s", leftUsers, expLeftUsers)