summaryrefslogtreecommitdiff
path: root/src/conversation/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/app.rs')
-rw-r--r--src/conversation/app.rs17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/conversation/app.rs b/src/conversation/app.rs
index 5e07292..26886af 100644
--- a/src/conversation/app.rs
+++ b/src/conversation/app.rs
@@ -10,7 +10,7 @@ use super::{
use crate::{
clock::DateTime,
db::{Duplicate as _, NotFound as _},
- event::{Broadcaster, Event, Sequence, repo::Provider as _},
+ event::{Broadcaster, Sequence, repo::Provider as _},
message::repo::Provider as _,
name::{self, Name},
};
@@ -49,8 +49,7 @@ impl<'a> Conversations<'a> {
tx.commit().await?;
- self.events
- .broadcast(events.map(Event::from).collect::<Vec<_>>());
+ self.events.broadcast_from(events);
Ok(conversation.as_created())
}
@@ -105,8 +104,7 @@ impl<'a> Conversations<'a> {
tx.commit().await?;
- self.events
- .broadcast(events.map(Event::from).collect::<Vec<_>>());
+ self.events.broadcast_from(events);
Ok(())
}
@@ -134,13 +132,8 @@ impl<'a> Conversations<'a> {
tx.commit().await?;
- self.events.broadcast(
- events
- .into_iter()
- .kmerge_by(Sequence::merge)
- .map(Event::from)
- .collect::<Vec<_>>(),
- );
+ self.events
+ .broadcast_from(events.into_iter().kmerge_by(Sequence::merge));
Ok(())
}