Change euph packet representation
This commit is contained in:
parent
03c1fe7f34
commit
a4a8174ea3
8 changed files with 506 additions and 415 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{has_packet_type, HasPacketType, Message, PacketType, SessionView, Snowflake, UserId};
|
||||
use super::{Message, SessionView, Snowflake, UserId};
|
||||
|
||||
/// Retrieve the full content of a single message in the room.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -11,14 +11,10 @@ pub struct GetMessage {
|
|||
pub id: Snowflake,
|
||||
}
|
||||
|
||||
has_packet_type!(GetMessage);
|
||||
|
||||
/// The message retrieved by [`GetMessage`].
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct GetMessageReply(pub Message);
|
||||
|
||||
has_packet_type!(GetMessageReply);
|
||||
|
||||
/// Request messages from the room's message log.
|
||||
///
|
||||
/// This can be used to supplement the log provided by snapshot-event (for
|
||||
|
|
@ -31,8 +27,6 @@ pub struct Log {
|
|||
pub before: Option<Snowflake>,
|
||||
}
|
||||
|
||||
has_packet_type!(Log);
|
||||
|
||||
/// List of messages from the room's message log.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct LogReply {
|
||||
|
|
@ -42,8 +36,6 @@ pub struct LogReply {
|
|||
pub before: Option<Snowflake>,
|
||||
}
|
||||
|
||||
has_packet_type!(LogReply);
|
||||
|
||||
/// Set the name you present to the room.
|
||||
///
|
||||
/// This name applies to all messages sent during this session, until the nick
|
||||
|
|
@ -54,8 +46,6 @@ pub struct Nick {
|
|||
pub name: String,
|
||||
}
|
||||
|
||||
has_packet_type!(Nick);
|
||||
|
||||
/// Confirms the [`Nick`] command.
|
||||
///
|
||||
/// Returns the session's former and new names (the server may modify the
|
||||
|
|
@ -72,8 +62,6 @@ pub struct NickReply {
|
|||
pub to: String,
|
||||
}
|
||||
|
||||
has_packet_type!(NickReply);
|
||||
|
||||
/// Constructs a virtual room for private messaging between the client and the
|
||||
/// given [`UserId`].
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -82,8 +70,6 @@ pub struct PmInitiate {
|
|||
pub user_id: UserId,
|
||||
}
|
||||
|
||||
has_packet_type!(PmInitiate);
|
||||
|
||||
/// Provides the PMID for the requested private messaging room.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PmInitiateReply {
|
||||
|
|
@ -93,8 +79,6 @@ pub struct PmInitiateReply {
|
|||
pub to_nick: String,
|
||||
}
|
||||
|
||||
has_packet_type!(PmInitiateReply);
|
||||
|
||||
/// Send a message to a room.
|
||||
///
|
||||
/// The session must be successfully joined with the room. This message will be
|
||||
|
|
@ -114,27 +98,19 @@ pub struct Send {
|
|||
pub parent: Option<Snowflake>,
|
||||
}
|
||||
|
||||
has_packet_type!(Send);
|
||||
|
||||
/// The message that was sent.
|
||||
///
|
||||
/// this includes the message id, which was populated by the server.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SendReply(pub Message);
|
||||
|
||||
has_packet_type!(SendReply);
|
||||
|
||||
/// Request a list of sessions currently joined in the room.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Who;
|
||||
|
||||
has_packet_type!(Who);
|
||||
|
||||
/// Lists the sessions currently joined in the room.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct WhoReply {
|
||||
/// A list of session views.
|
||||
listing: Vec<SessionView>,
|
||||
}
|
||||
|
||||
has_packet_type!(WhoReply);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue