Commit 6042c7bfeb
Unregistered key
Layout: unified · split
src/room_buffer.rs +8 −4
| @@ -247,10 +247,14 @@ impl RoomBuffer { | ||
| 247 | 247 | .send_typing_notice(&*room_id, &*user_id, typing) |
| 248 | 248 | .await; |
| 249 | 249 | |
| 250 | // If we got a successfull response mark when we sent out the | |
| 251 | // notice so we don't send out another one while this one is | |
| 252 | // active, or if we disabled the notice mark that no notice is | |
| 253 | // active. | |
| 250 | // We need to record the time when the last typing notice was | |
| 251 | // sent to ensure we don't send out new ones while a previous | |
| 252 | // one is active. If we cancelled the last notice (`!typing`), | |
| 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 | 258 | if response.is_ok() { |
| 255 | 259 | if typing { |
| 256 | 260 | *typing_time.borrow_mut() = Some(Instant::now()); |