diff --git a/src/database/entities/message.rs b/src/database/entities/message.rs index fd38f940fca3c99761e7a03dff4ea290c7fe8840..e48775c773d14691b66cc557f84bce5eb090bdd1 100644 --- a/src/database/entities/message.rs +++ b/src/database/entities/message.rs @@ -78,10 +78,12 @@ impl Message { })?; let channel = self.channel.clone(); - ClientboundNotification::MessageDelete { id: self.id.clone() } - .publish(channel) - .await - .ok(); + ClientboundNotification::MessageDelete { + id: self.id.clone(), + } + .publish(channel) + .await + .ok(); Ok(()) } diff --git a/src/notifications/events.rs b/src/notifications/events.rs index e51ff9a4e05d1427a54c54671c9ef897bc2130bb..f370af8062f2674f2f95d0c4b696bba332475a0f 100644 --- a/src/notifications/events.rs +++ b/src/notifications/events.rs @@ -112,10 +112,7 @@ pub fn prehandle_hook(notification: &ClientboundNotification) { pub fn posthandle_hook(notification: &ClientboundNotification) { match ¬ification { ClientboundNotification::ChannelDelete { id } => { - get_hive() - .hive - .drop_topic(&id) - .ok(); + get_hive().hive.drop_topic(&id).ok(); } ClientboundNotification::UserRelationship { id, user, status } => { if status == &RelationshipStatus::None { @@ -123,7 +120,7 @@ pub fn posthandle_hook(notification: &ClientboundNotification) { .hive .unsubscribe(&id.to_string(), &user.to_string()) .ok(); - } + } } _ => {} } diff --git a/src/routes/channels/delete_channel.rs b/src/routes/channels/delete_channel.rs index ac871c59bcf1ad5f165dad4768d1cdc319526135..b328b5d443c307123911ae1186ca0ba47a7eb4c5 100644 --- a/src/routes/channels/delete_channel.rs +++ b/src/routes/channels/delete_channel.rs @@ -66,7 +66,7 @@ pub async fn req(user: User, target: Ref) -> Result<()> { target.publish_update(json!({ "owner": new_owner })).await?; } else { - return target.delete().await + return target.delete().await; } } else { get_collection("channels") diff --git a/src/routes/channels/message_edit.rs b/src/routes/channels/message_edit.rs index cedba51e2011fd67215386b1a69210bbd7700088..10bed645f79f26732efc36086a67b694ca99e9e4 100644 --- a/src/routes/channels/message_edit.rs +++ b/src/routes/channels/message_edit.rs @@ -50,5 +50,7 @@ pub async fn req(user: User, target: Ref, msg: Ref, edit: Json<Data>) -> Result< with: "message", })?; - message.publish_update(json!({ "content": edit.content, "edited": DateTime(edited) })).await + message + .publish_update(json!({ "content": edit.content, "edited": DateTime(edited) })) + .await }