feat: Chat request implementation #14
1 changed files with 4 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
//! Events that the client send it
|
//! Events that the client send it
|
||||||
|
|
||||||
use oxidetalis_core::types::Signature;
|
use oxidetalis_core::types::{PublicKey, Signature};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{nonce::NonceCache, utils};
|
use crate::{nonce::NonceCache, utils};
|
||||||
|
@ -24,6 +24,7 @@ use crate::{nonce::NonceCache, utils};
|
||||||
/// Client websocket event
|
/// Client websocket event
|
||||||
#[derive(Deserialize, Clone, Debug)]
|
#[derive(Deserialize, Clone, Debug)]
|
||||||
pub struct ClientEvent {
|
pub struct ClientEvent {
|
||||||
|
#[serde(flatten)]
|
||||||
pub event: ClientEventType,
|
pub event: ClientEventType,
|
||||||
signature: Signature,
|
signature: Signature,
|
||||||
}
|
}
|
||||||
|
@ -36,6 +37,8 @@ pub enum ClientEventType {
|
||||||
Ping { timestamp: u64 },
|
Ping { timestamp: u64 },
|
||||||
/// Pong event
|
/// Pong event
|
||||||
Pong { timestamp: u64 },
|
Pong { timestamp: u64 },
|
||||||
|
/// Request to chat with a user
|
||||||
|
ChatRequest { to: PublicKey },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ClientEventType {
|
impl ClientEventType {
|
||||||
|
|
Loading…
Reference in a new issue