mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
Implement typing over federation (#949)
Also fix a pet peeve of mine: not putting units on things!!! Manually tested on p2p and works well, with some fudge factor delay.
This commit is contained in:
parent
11a8059bba
commit
8fbe9f4078
10 changed files with 75 additions and 25 deletions
|
@ -46,7 +46,7 @@ func (t *EDUServerInputAPI) InputTypingEvent(
|
|||
if ite.Typing {
|
||||
// user is typing, update our current state of users typing.
|
||||
expireTime := ite.OriginServerTS.Time().Add(
|
||||
time.Duration(ite.Timeout) * time.Millisecond,
|
||||
time.Duration(ite.TimeoutMS) * time.Millisecond,
|
||||
)
|
||||
t.Cache.AddTypingUser(ite.UserID, ite.RoomID, &expireTime)
|
||||
} else {
|
||||
|
@ -69,7 +69,7 @@ func (t *EDUServerInputAPI) sendEvent(ite *api.InputTypingEvent) error {
|
|||
|
||||
if ev.Typing {
|
||||
expireTime := ite.OriginServerTS.Time().Add(
|
||||
time.Duration(ite.Timeout) * time.Millisecond,
|
||||
time.Duration(ite.TimeoutMS) * time.Millisecond,
|
||||
)
|
||||
ote.ExpireTime = &expireTime
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue