feat: Chat request implementation #14
3 changed files with 9 additions and 0 deletions
|
@ -98,6 +98,7 @@ pub trait UsersStatusExt {
|
|||
}
|
||||
|
||||
impl UsersStatusExt for DatabaseConnection {
|
||||
#[logcall::logcall]
|
||||
async fn is_whitelisted(
|
||||
&self,
|
||||
whitelister: &UserModel,
|
||||
|
@ -114,6 +115,7 @@ impl UsersStatusExt for DatabaseConnection {
|
|||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
#[logcall::logcall]
|
||||
async fn is_blacklisted(
|
||||
&self,
|
||||
blacklister: &UserModel,
|
||||
|
@ -130,6 +132,7 @@ impl UsersStatusExt for DatabaseConnection {
|
|||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
#[logcall::logcall]
|
||||
async fn add_to_whitelist(
|
||||
&self,
|
||||
whitelister: &UserModel,
|
||||
|
@ -172,6 +175,7 @@ impl UsersStatusExt for DatabaseConnection {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[logcall::logcall]
|
||||
async fn add_to_blacklist(
|
||||
&self,
|
||||
blacklister: &UserModel,
|
||||
|
@ -214,6 +218,7 @@ impl UsersStatusExt for DatabaseConnection {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[logcall::logcall]
|
||||
async fn remove_from_whitelist(
|
||||
&self,
|
||||
whitelister: &UserModel,
|
||||
|
@ -232,6 +237,7 @@ impl UsersStatusExt for DatabaseConnection {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[logcall::logcall]
|
||||
async fn remove_from_blacklist(
|
||||
&self,
|
||||
blacklister: &UserModel,
|
||||
|
|
|
@ -31,6 +31,7 @@ use crate::websocket::errors::WsError;
|
|||
/// Signed marker, used to indicate that the event is signed
|
||||
pub struct Signed;
|
||||
/// Unsigned marker, used to indicate that the event is unsigned
|
||||
#[derive(Debug)]
|
||||
pub struct Unsigned;
|
||||
|
||||
/// Server websocket event
|
||||
|
|
|
@ -32,6 +32,7 @@ use crate::{
|
|||
};
|
||||
|
||||
/// Handle a chat request from a user.
|
||||
#[logcall::logcall]
|
||||
pub async fn handle_chat_request(
|
||||
db: &DatabaseConnection,
|
||||
from: Option<&UserModel>,
|
||||
|
@ -78,6 +79,7 @@ pub async fn handle_chat_request(
|
|||
None
|
||||
}
|
||||
|
||||
#[logcall::logcall]
|
||||
pub async fn handle_chat_response(
|
||||
db: &DatabaseConnection,
|
||||
recipient: Option<&UserModel>,
|
||||
|
|
Loading…
Reference in a new issue