aboutsummaryrefslogtreecommitdiff
path: root/typingserver/input/input.go
diff options
context:
space:
mode:
Diffstat (limited to 'typingserver/input/input.go')
-rw-r--r--typingserver/input/input.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/typingserver/input/input.go b/typingserver/input/input.go
index b9968ce4..0e2fbe51 100644
--- a/typingserver/input/input.go
+++ b/typingserver/input/input.go
@@ -57,15 +57,21 @@ 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 {
+ expireTime := ite.OriginServerTS.Time().Add(
+ time.Duration(ite.Timeout) * time.Millisecond,
+ )
+ ote.ExpireTime = &expireTime
}
eventJSON, err := json.Marshal(ote)