Commit 6042c7bfeb

6042c7bfebb86e71dd16ef1fb48a398647b1eda0

parent: c45881e085

Unregistered key

poljar <poljar@termina.org.uk> · 2020-07-13 15:24 UTC
committer: <noreply@github.com>

Update src/room_buffer.rs

Co-authored-by: Denis Kasak <dkasak@users.noreply.github.com>

Layout: unified · split

src/room_buffer.rs +8 −4
@@ -247,10 +247,14 @@ impl RoomBuffer {
247 .send_typing_notice(&*room_id, &*user_id, typing) 247 .send_typing_notice(&*room_id, &*user_id, typing)
248 .await; 248 .await;
249 249
250 // If we got a successfull response mark when we sent out the 250 // We need to record the time when the last typing notice was
251 // notice so we don't send out another one while this one is 251 // sent to ensure we don't send out new ones while a previous
252 // active, or if we disabled the notice mark that no notice is 252 // one is active. If we cancelled the last notice (`!typing`),
253 // active. 253 // we record that there is currently no active notice.
254 //
255 // An unsuccessful response indicates the send operation failed.
256 // In this case we need to retry, so we don't update anything.
257
254 if response.is_ok() { 258 if response.is_ok() {
255 if typing { 259 if typing {
256 *typing_time.borrow_mut() = Some(Instant::now()); 260 *typing_time.borrow_mut() = Some(Instant::now());