Fix update_one failing on sys message.

This commit is contained in:
Paul
2021-04-03 21:37:24 +01:00
parent a547177325
commit 2050a0609f

View File

@@ -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