From e7cf44946f4b4e146e18bdf7f6573d7029a32c6a Mon Sep 17 00:00:00 2001 From: Cnly Date: Wed, 26 Jun 2019 23:03:50 +0800 Subject: [PATCH] Fix necessary field not set properly in TypingEvent; clean up OutputTypingEvent Signed-off-by: Alex Chen --- typingserver/api/output.go | 2 -- typingserver/input/input.go | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/typingserver/api/output.go b/typingserver/api/output.go index ebf4c719d..8696acf49 100644 --- a/typingserver/api/output.go +++ b/typingserver/api/output.go @@ -23,8 +23,6 @@ type OutputTypingEvent struct { // ExpireTime is the interval after which the user should no longer be // considered typing. Only available if Event.Typing is true. ExpireTime *time.Time - // Users typing in the room when the event was generated. - TypingUsers []string `json:"typing_users"` } // TypingEvent represents a matrix edu event of type 'm.typing'. diff --git a/typingserver/input/input.go b/typingserver/input/input.go index 182bda090..0e2fbe51f 100644 --- a/typingserver/input/input.go +++ b/typingserver/input/input.go @@ -57,15 +57,14 @@ func (t *TypingServerInputAPI) InputTypingEvent( } func (t *TypingServerInputAPI) sendEvent(ite *api.InputTypingEvent) error { - userIDs := t.Cache.GetTypingUsers(ite.RoomID) ev := &api.TypingEvent{ Type: gomatrixserverlib.MTyping, RoomID: ite.RoomID, UserID: ite.UserID, + Typing: ite.Typing, } ote := &api.OutputTypingEvent{ - Event: *ev, - TypingUsers: userIDs, + Event: *ev, } if ev.Typing {