summaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/handlers/send/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/conversation/handlers/send/mod.rs b/src/conversation/handlers/send/mod.rs
index 979dd24..67d3a70 100644
--- a/src/conversation/handlers/send/mod.rs
+++ b/src/conversation/handlers/send/mod.rs
@@ -12,19 +12,23 @@ use crate::{
Body, Message,
app::{Messages, SendError},
},
+ push::Publish,
token::extract::Identity,
};
#[cfg(test)]
mod test;
-pub async fn handler(
- State(messages): State<Messages>,
+pub async fn handler<P>(
+ State(messages): State<Messages<P>>,
Path(conversation): Path<PathInfo>,
RequestedAt(sent_at): RequestedAt,
identity: Identity,
Json(request): Json<Request>,
-) -> Result<Response, Error> {
+) -> Result<Response, Error>
+where
+ P: Publish,
+{
let message = messages
.send(&conversation, &identity.login, &sent_at, &request.body)
.await?;