Skip to content
Snippets Groups Projects
Commit 3a63d502 authored by insert's avatar insert
Browse files

Cargo fmt.

parent 8bb694a1
No related merge requests found
Pipeline #489 passed with stage
in 1 minute and 57 seconds
...@@ -78,10 +78,12 @@ impl Message { ...@@ -78,10 +78,12 @@ impl Message {
})?; })?;
let channel = self.channel.clone(); let channel = self.channel.clone();
ClientboundNotification::MessageDelete { id: self.id.clone() } ClientboundNotification::MessageDelete {
.publish(channel) id: self.id.clone(),
.await }
.ok(); .publish(channel)
.await
.ok();
Ok(()) Ok(())
} }
......
...@@ -112,10 +112,7 @@ pub fn prehandle_hook(notification: &ClientboundNotification) { ...@@ -112,10 +112,7 @@ pub fn prehandle_hook(notification: &ClientboundNotification) {
pub fn posthandle_hook(notification: &ClientboundNotification) { pub fn posthandle_hook(notification: &ClientboundNotification) {
match &notification { match &notification {
ClientboundNotification::ChannelDelete { id } => { ClientboundNotification::ChannelDelete { id } => {
get_hive() get_hive().hive.drop_topic(&id).ok();
.hive
.drop_topic(&id)
.ok();
} }
ClientboundNotification::UserRelationship { id, user, status } => { ClientboundNotification::UserRelationship { id, user, status } => {
if status == &RelationshipStatus::None { if status == &RelationshipStatus::None {
...@@ -123,7 +120,7 @@ pub fn posthandle_hook(notification: &ClientboundNotification) { ...@@ -123,7 +120,7 @@ pub fn posthandle_hook(notification: &ClientboundNotification) {
.hive .hive
.unsubscribe(&id.to_string(), &user.to_string()) .unsubscribe(&id.to_string(), &user.to_string())
.ok(); .ok();
} }
} }
_ => {} _ => {}
} }
......
...@@ -66,7 +66,7 @@ pub async fn req(user: User, target: Ref) -> Result<()> { ...@@ -66,7 +66,7 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
target.publish_update(json!({ "owner": new_owner })).await?; target.publish_update(json!({ "owner": new_owner })).await?;
} else { } else {
return target.delete().await return target.delete().await;
} }
} else { } else {
get_collection("channels") get_collection("channels")
......
...@@ -50,5 +50,7 @@ pub async fn req(user: User, target: Ref, msg: Ref, edit: Json<Data>) -> Result< ...@@ -50,5 +50,7 @@ pub async fn req(user: User, target: Ref, msg: Ref, edit: Json<Data>) -> Result<
with: "message", with: "message",
})?; })?;
message.publish_update(json!({ "content": edit.content, "edited": DateTime(edited) })).await message
.publish_update(json!({ "content": edit.content, "edited": DateTime(edited) }))
.await
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment