Commit 6042c7bfeb
Unregistered key
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()); |