Private
Public Access
1
0

Implements mark as read

This commit is contained in:
2025-06-18 15:02:04 -07:00
parent fa6c7c50b7
commit 3b30cb77c8
13 changed files with 172 additions and 13 deletions

View File

@@ -271,6 +271,13 @@ impl<K: AuthenticationStore + Send + Sync> APIInterface for HTTPAPIClient<K> {
Ok(token)
}
async fn mark_conversation_as_read(&mut self, conversation_id: &ConversationID) -> Result<(), Self::Error> {
// SERVER JANK: This should be POST, but it's GET for some reason.
let endpoint = format!("markConversation?guid={}", conversation_id);
self.response_with_body_retry(&endpoint, Method::GET, Body::empty, true).await?;
Ok(())
}
async fn get_messages(
&mut self,
conversation_id: &ConversationID,

View File

@@ -64,6 +64,9 @@ pub trait APIInterface {
// (POST) /authenticate
async fn authenticate(&mut self, credentials: Credentials) -> Result<JwtToken, Self::Error>;
// (GET) /markConversation
async fn mark_conversation_as_read(&mut self, conversation_id: &ConversationID) -> Result<(), Self::Error>;
// (WS) /updates
async fn open_event_socket(
&mut self,

View File

@@ -148,4 +148,8 @@ impl APIInterface for TestClient {
{
Ok(String::from("test"))
}
async fn mark_conversation_as_read(&mut self, conversation_id: &ConversationID) -> Result<(), Self::Error> {
Ok(())
}
}