blob: d3b47199ffe97a252e38a83adf5a727472f90e31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use faker_rand::lorem::Paragraphs;
use crate::{
app::App,
channel::Channel,
clock::RequestedAt,
login::Login,
message::{self, Body, Message},
};
pub async fn send(app: &App, channel: &Channel, sender: &Login, sent_at: &RequestedAt) -> Message {
let body = propose();
app.messages()
.send(&channel.id, sender, sent_at, &body)
.await
.expect("should succeed if the channel exists")
}
pub fn propose() -> Body {
rand::random::<Paragraphs>().to_string().into()
}
pub fn fictitious() -> message::Id {
message::Id::generate()
}
|