feat: Chat request implementation #14

Manually merged
awiteb merged 55 commits from awiteb/chat-request-and-response into master 2024-07-18 14:21:39 +02:00 AGit
Showing only changes of commit 8f791acd5d - Show all commits

View file

@ -51,8 +51,6 @@ pub enum ServerEventType {
Ping { timestamp: u64 }, Ping { timestamp: u64 },
/// Pong event /// Pong event
Pong { timestamp: u64 }, Pong { timestamp: u64 },
/// Message event, contain a message to the client
Message { msg: String },
/// New chat request from someone /// New chat request from someone
ChatRequest { from: PublicKey }, ChatRequest { from: PublicKey },
/// New chat request response from someone /// New chat request response from someone
@ -97,11 +95,6 @@ impl ServerEvent<Unsigned> {
}) })
} }
/// Create message event
pub fn message(msg: impl Into<String>) -> Self {
Self::new(ServerEventType::Message { msg: msg.into() })
}
/// Create chat request event /// Create chat request event
pub fn chat_request(from: &PublicKey) -> Self { pub fn chat_request(from: &PublicKey) -> Self {
Self::new(ServerEventType::ChatRequest { from: *from }) Self::new(ServerEventType::ChatRequest { from: *from })