summaryrefslogtreecommitdiff
path: root/src/conversation/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/handlers')
-rw-r--r--src/conversation/handlers/send/mod.rs7
-rw-r--r--src/conversation/handlers/send/test.rs2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/conversation/handlers/send/mod.rs b/src/conversation/handlers/send/mod.rs
index 1c8ac63..c8be59c 100644
--- a/src/conversation/handlers/send/mod.rs
+++ b/src/conversation/handlers/send/mod.rs
@@ -25,7 +25,7 @@ pub async fn handler(
) -> Result<Response, Error> {
let message = app
.messages()
- .send(&conversation, &identity.user, &sent_at, &request.body)
+ .send(&conversation, &identity.login, &sent_at, &request.body)
.await?;
Ok(Response(message))
@@ -57,7 +57,10 @@ impl IntoResponse for Error {
SendError::ConversationNotFound(_) | SendError::ConversationDeleted(_) => {
NotFound(error).into_response()
}
- SendError::Name(_) | SendError::Database(_) => Internal::from(error).into_response(),
+ SendError::SenderNotFound(_)
+ | SendError::SenderDeleted(_)
+ | SendError::Name(_)
+ | SendError::Database(_) => Internal::from(error).into_response(),
}
}
}
diff --git a/src/conversation/handlers/send/test.rs b/src/conversation/handlers/send/test.rs
index bd32510..8863090 100644
--- a/src/conversation/handlers/send/test.rs
+++ b/src/conversation/handlers/send/test.rs
@@ -55,7 +55,7 @@ async fn messages_in_order() {
.await
{
assert_eq!(*sent_at, event.at());
- assert_eq!(sender.user.id, event.message.sender);
+ assert_eq!(sender.login.id, event.message.sender);
assert_eq!(body, event.message.body);
}
}