forked from jmug/stoatchat
Fix update_one failing on sys message.
This commit is contained in:
@@ -119,19 +119,21 @@ impl Message {
|
|||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Channel::Group { id, .. } => {
|
Channel::Group { id, .. } => {
|
||||||
channels
|
if let Content::Text(_) = &self.content {
|
||||||
.update_one(
|
channels
|
||||||
doc! { "_id": id },
|
.update_one(
|
||||||
doc! {
|
doc! { "_id": id },
|
||||||
"$set": set
|
doc! {
|
||||||
},
|
"$set": set
|
||||||
None,
|
},
|
||||||
)
|
None,
|
||||||
.await
|
)
|
||||||
.map_err(|_| Error::DatabaseError {
|
.await
|
||||||
operation: "update_one",
|
.map_err(|_| Error::DatabaseError {
|
||||||
with: "channel",
|
operation: "update_one",
|
||||||
})?;
|
with: "channel",
|
||||||
|
})?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
@@ -140,7 +142,7 @@ impl Message {
|
|||||||
ClientboundNotification::Message(self)
|
ClientboundNotification::Message(self)
|
||||||
.publish(channel.id().to_string())
|
.publish(channel.id().to_string())
|
||||||
.await
|
.await
|
||||||
.ok();
|
.unwrap();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Web Push Test Code
|
Web Push Test Code
|
||||||
|
|||||||
Reference in New Issue
Block a user