summaryrefslogtreecommitdiff
path: root/src/message/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/message/app.rs')
-rw-r--r--src/message/app.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/message/app.rs b/src/message/app.rs
index 33ea8ad..385c92e 100644
--- a/src/message/app.rs
+++ b/src/message/app.rs
@@ -35,16 +35,13 @@ impl<'a> Messages<'a> {
.await
.not_found(|| SendError::ChannelNotFound(channel.clone()))?;
let sent = tx.sequence().next(sent_at).await?;
- let message = tx
- .messages()
- .create(&channel.snapshot(), sender, &sent, body)
- .await?;
+ let message = tx.messages().create(&channel, sender, &sent, body).await?;
tx.commit().await?;
self.events
.broadcast(message.events().map(Event::from).collect::<Vec<_>>());
- Ok(message.snapshot())
+ Ok(message.as_sent())
}
pub async fn delete(&self, message: &Id, deleted_at: &DateTime) -> Result<(), DeleteError> {