move typing feature up one level out of rooms.edus.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -1003,16 +1003,10 @@ async fn load_joined_room(
|
||||
.map(|(_, _, v)| v)
|
||||
.collect();
|
||||
|
||||
if services()
|
||||
.rooms
|
||||
.edus
|
||||
.typing
|
||||
.last_typing_update(room_id)
|
||||
.await? > since
|
||||
{
|
||||
if services().rooms.typing.last_typing_update(room_id).await? > since {
|
||||
edus.push(
|
||||
serde_json::from_str(
|
||||
&serde_json::to_string(&services().rooms.edus.typing.typings_all(room_id).await?)
|
||||
&serde_json::to_string(&services().rooms.typing.typings_all(room_id).await?)
|
||||
.expect("event is valid, we just created it"),
|
||||
)
|
||||
.expect("event is valid, we just created it"),
|
||||
|
||||
@@ -28,14 +28,12 @@ pub async fn create_typing_event_route(
|
||||
);
|
||||
services()
|
||||
.rooms
|
||||
.edus
|
||||
.typing
|
||||
.typing_add(sender_user, &body.room_id, utils::millis_since_unix_epoch() + duration)
|
||||
.await?;
|
||||
} else {
|
||||
services()
|
||||
.rooms
|
||||
.edus
|
||||
.typing
|
||||
.typing_remove(sender_user, &body.room_id)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user