Reformat ChatProtocolMessages

This commit is contained in:
Jaidyn Ann 2021-06-29 11:41:26 -05:00
parent 9a75767faa
commit 41b6164bbc

View File

@ -32,26 +32,26 @@ enum im_what_code {
//! Request a server-side contact list from protocol →Protocol //! Request a server-side contact list from protocol →Protocol
IM_GET_CONTACT_LIST = 1, IM_GET_CONTACT_LIST = 1,
//! Server-side contact list received →App /*! Server-side contact list received →App
// Requires: Stringlist "user_id" Requires: Stringlist "user_id" */
IM_CONTACT_LIST = 2, IM_CONTACT_LIST = 2,
//! Add a contact to the roster →Protocol /*! Add a contact to the roster →Protocol
// The slots for this message are determined by the protocol's The slots for this message are determined by the protocol's
// "roster" template (ChatProtocol::SettingsTemplate("roster")) "roster" template (ChatProtocol::SettingsTemplate("roster")) */
IM_CONTACT_LIST_ADD_CONTACT = 3, IM_CONTACT_LIST_ADD_CONTACT = 3,
//! Remove a contact →Protocol /*! Remove a contact →Protocol
// Requires: String "user_id" Requires: String "user_id" */
IM_CONTACT_LIST_REMOVE_CONTACT = 4, IM_CONTACT_LIST_REMOVE_CONTACT = 4,
//! Contact(s) removed from the server-side list →App /*! Contact(s) removed from the server-side list →App
// Requires: String "user_id" Requires: String "user_id" */
IM_CONTACT_LIST_CONTACT_REMOVED = 5, IM_CONTACT_LIST_CONTACT_REMOVED = 5,
//! Edit some data on contact →Protocol /*! Edit some data on contact →Protocol
// The slots for this message are determined by the protocol's The slots for this message are determined by the protocol's
// "roster" template (ChatProtocol::SettingsTemplate("roster")) "roster" template (ChatProtocol::SettingsTemplate("roster")) */
IM_CONTACT_LIST_EDIT_CONTACT = 6, IM_CONTACT_LIST_EDIT_CONTACT = 6,
@ -59,32 +59,32 @@ enum im_what_code {
* Messages related to text chat. * Messages related to text chat.
*/ */
//! Send a chat message →Protocol /*! Send a chat message →Protocol
// Requires: String "user_id", String "body" Requires: String "user_id", String "body" */
IM_SEND_MESSAGE = 20, IM_SEND_MESSAGE = 20,
//! Chat message has been sent →App /*! Chat message has been sent →App
// If no user_id is specified, it's treated as a system message If no user_id is specified, it's treated as a system message
// Requires: String "chat_id", String "body" Requires: String "chat_id", String "body"
// Allows: String "user_id" Allows: String "user_id" */
IM_MESSAGE_SENT = 21, IM_MESSAGE_SENT = 21,
//! Chat message received →App /*! Chat message received →App
// Requires: String "chat_id", String "user_id", String "body" Requires: String "chat_id", String "user_id", String "body" */
IM_MESSAGE_RECEIVED = 22, IM_MESSAGE_RECEIVED = 22,
//! Logs received →App /*! Logs received →App
// Without "when" (a time_t), the logged message will lack a timestamp Without "when" (a time_t), the logged message will lack a timestamp
// Requires: Strings "chat_id", Strings "user_id", Strings "body" Requires: Strings "chat_id", Strings "user_id", Strings "body"
// Accepts: in64s "when" Accepts: in64s "when" */
IM_LOGS_RECEIVED = 23, IM_LOGS_RECEIVED = 23,
//! User started typing →App /*! User started typing →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_USER_STARTED_TYPING = 24, IM_USER_STARTED_TYPING = 24,
//! User stopped typing →App /*! User stopped typing →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_USER_STOPPED_TYPING = 25, IM_USER_STOPPED_TYPING = 25,
@ -103,29 +103,30 @@ enum im_what_code {
* Messages related to contact's information received from protocols. * Messages related to contact's information received from protocols.
*/ */
//! Received contact new status →App /*! Received contact new status →App
// Requires: String "user_id", int32/UserStatus "status" Requires: String "user_id", int32/UserStatus "status" */
IM_STATUS_SET = 60, IM_STATUS_SET = 60,
//! User's avatar icon was changed →App /*! User's avatar icon was changed →App
// Requires: String "user_id", Ref "ref" Requires: String "user_id", Ref "ref" */
IM_AVATAR_SET = 61, IM_AVATAR_SET = 61,
//! Get contact information →Protocol //! Get contact information →Protocol
IM_GET_CONTACT_INFO = 62, IM_GET_CONTACT_INFO = 62,
//! Received contact information →App /*! Received contact information →App
// Requires: String "user_id" Requires: String "user_id"
// Accepts: String "user_name", String "message", int32/UserStatus "status" Accepts: String "user_name", String "message",
int32/UserStatus "status" */
IM_CONTACT_INFO = 63, IM_CONTACT_INFO = 63,
//! Request contact information →Protocol //! Request contact information →Protocol
IM_GET_EXTENDED_CONTACT_INFO = 64, IM_GET_EXTENDED_CONTACT_INFO = 64,
//! Received contact information →App /*! Received contact information →App
// Requires: String "user_id", Requires: String "user_id",
// non-standard slots used by "roster" template non-standard slots used by "roster" template
// Accepts: String "user_name", String "full_name" Accepts: String "user_name", String "full_name" */
IM_EXTENDED_CONTACT_INFO = 65, IM_EXTENDED_CONTACT_INFO = 65,
@ -133,30 +134,33 @@ enum im_what_code {
* Messages that involve changing own information. * Messages that involve changing own information.
*/ */
//! Change own nickname →Protocol /*! Change own nickname →Protocol
// Requires: String "user_name" Requires: String "user_name" */
IM_SET_OWN_NICKNAME = 80, IM_SET_OWN_NICKNAME = 80,
//! Own nickname was changed →App //! Own nickname was changed →App
IM_OWN_NICKNAME_SET = 81, IM_OWN_NICKNAME_SET = 81,
//! Change own status →Protocol /*! Change own status →Protocol
// Requires: int32/UserStatus "status" Requires: int32/UserStatus "status" */
IM_SET_OWN_STATUS = 82, IM_SET_OWN_STATUS = 82,
// Own status was changed →App /*! Own status was changed →App
// Requires: int32/UserStatus "status" Requires: int32/UserStatus "status" */
IM_OWN_STATUS_SET = 83, IM_OWN_STATUS_SET = 83,
//! Get own contact information /*! Get own contact information →App
// Requires: String "user_id" Must be send right after connection is established,
before any room events, etc.
Requires: String "user_id"
Allows: String "user_name" */
IM_OWN_CONTACT_INFO = 84, IM_OWN_CONTACT_INFO = 84,
//! Change own avatar icon //! Change own avatar icon
IM_SET_OWN_AVATAR = 85, IM_SET_OWN_AVATAR = 85,
//! Own avatar icon was changed /*! Own avatar icon was changed
// Requires: Ref "ref" Requires: Ref "ref" */
IM_OWN_AVATAR_SET = 86, IM_OWN_AVATAR_SET = 86,
@ -195,7 +199,7 @@ enum im_what_code {
* Miscellaneous. * Miscellaneous.
*/ */
//! Progress message received, could be login sequence, file transfer etc... //! Progress message received, could be login sequence, file transfer etc
IM_PROGRESS = 140, IM_PROGRESS = 140,
//! Notifications //! Notifications
@ -206,89 +210,89 @@ enum im_what_code {
* Room membership * Room membership
*/ */
//! Create an individual chat →Protocol /*! Create an individual chat →Protocol
// Individual chats and rooms are really the same thing (at least according Individual chats and rooms are really the same thing (at least according
// to App)― the only difference is in how they're created and joined. to App) the only difference is in how they're created and joined.
// A "chat" should be uniquely tied to a single user, and its chat_id A "chat" should be uniquely tied to a single user, and its chat_id
// should be derivable from the user's ID (when sent back from should be derivable from the user's ID (when sent back from
// CHAT_CREATED). It doesn't matter how you get this done, really. CHAT_CREATED). It doesn't matter how you get this done, really.
// Requires: String "user_id" Requires: String "user_id" */
IM_CREATE_CHAT = 150, IM_CREATE_CHAT = 150,
//! Chat has been created →App /*! Chat has been created →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_CHAT_CREATED = 151, IM_CHAT_CREATED = 151,
//! Create a room →Protocol /*! Create a room →Protocol
// The required slots for this message are completely determined by the The required slots for this message are completely determined by the
// protocol itself― the protocol will just receive data from the protocol itself the protocol will just receive data from the
// "room" template (which is fetched via "room" template (which is fetched via
// ChatProtocol::SettingsTemplate("room") ChatProtocol::SettingsTemplate("room") */
IM_CREATE_ROOM = 152, IM_CREATE_ROOM = 152,
//! Inform App room was created →App /*! Inform App room was created →App
// Just a semantically-dressed IM_ROOM_JOINED Just a semantically-dressed IM_ROOM_JOINED
// Requires: String "chat_id" Requires: String "chat_id" */
IM_ROOM_CREATED = 153, IM_ROOM_CREATED = 153,
//! Join a room →Protocol /*! Join a room →Protocol
// Requires: String "chat_id" Requires: String "chat_id" */
IM_JOIN_ROOM = 154, IM_JOIN_ROOM = 154,
//! Confirm the room's been joined →App /*! Confirm the room's been joined →App
// Requires: String "chat_id" Requires: String "chat_id" */
IM_ROOM_JOINED = 155, IM_ROOM_JOINED = 155,
//! User wants to leave the room →Protocol /*! User wants to leave the room →Protocol
// Requires: String "chat_id" Requires: String "chat_id" */
IM_LEAVE_ROOM = 156, IM_LEAVE_ROOM = 156,
//! User left the room →App /*! User left the room →App
// Requires: String "chat_id" Requires: String "chat_id" */
IM_ROOM_LEFT = 157, IM_ROOM_LEFT = 157,
//! Request a room's userlist →Protocol /*! Request a room's userlist →Protocol
// Requires: String "chat_id" Requires: String "chat_id" */
IM_GET_ROOM_PARTICIPANTS = 158, IM_GET_ROOM_PARTICIPANTS = 158,
//! Quietly add user(s) to the chat →App /*! Quietly add user(s) to the chat →App
// Shouldn't be sent automatically on joining a room. Shouldn't be sent automatically on joining a room.
// Requires: String "chat_id", StringList "user_id" Requires: String "chat_id", StringList "user_id"
// Accepts: StringList "user_name" Accepts: StringList "user_name" */
IM_ROOM_PARTICIPANTS = 159, IM_ROOM_PARTICIPANTS = 159,
//! User has explicitly joined →App /*! User has explicitly joined →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id"
// Accepts: String "body" Accepts: String "body" */
IM_ROOM_PARTICIPANT_JOINED = 160, IM_ROOM_PARTICIPANT_JOINED = 160,
//! A user left the room →App /*! A user left the room →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id"
// Accepts: String "user_name", String "body" Accepts: String "user_name", String "body" */
IM_ROOM_PARTICIPANT_LEFT = 161, IM_ROOM_PARTICIPANT_LEFT = 161,
//! Invite a user to a room →Protocol /*! Invite a user to a room →Protocol
// You can tell it succeded with IM_ROOM_PARTICIPANT_JOINED. You can tell it succeded with IM_ROOM_PARTICIPANT_JOINED.
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id"
// Accepts: String "body" Accepts: String "body" */
IM_ROOM_SEND_INVITE = 162, IM_ROOM_SEND_INVITE = 162,
//! Invitee explicitly refused →App /*! Invitee explicitly refused →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id"
// Accepts: String "user_name", String "body" Accepts: String "user_name", String "body" */
IM_ROOM_INVITE_REFUSED = 163, IM_ROOM_INVITE_REFUSED = 163,
//! User was invited to a room →App /*! User was invited to a room →App
// Requires: String "chat_id" Requires: String "chat_id"
// Accepts: String "user_id", String "chat_name", String "body" Accepts: String "user_id", String "chat_name", String "body" */
IM_ROOM_INVITE_RECEIVED = 164, IM_ROOM_INVITE_RECEIVED = 164,
//! User accepted an invite →Protocol /*! User accepted an invite →Protocol
// Requires: String "chat_id" Requires: String "chat_id" */
IM_ROOM_INVITE_ACCEPT = 165, IM_ROOM_INVITE_ACCEPT = 165,
//! User denies an invite →Protocol /*! User denies an invite →Protocol
// Requires: String "chat_id" Requires: String "chat_id" */
IM_ROOM_INVITE_REFUSE = 166, IM_ROOM_INVITE_REFUSE = 166,
@ -296,33 +300,33 @@ enum im_what_code {
* Room metadata * Room metadata
*/ */
//! Request a room's metadata →Protocol /*! Request a room's metadata →Protocol
// Requires: String "chat_id" Requires: String "chat_id" */
IM_GET_ROOM_METADATA = 170, IM_GET_ROOM_METADATA = 170,
//! Receive room metadata →App /*! Receive room metadata →App
// The idea is that all other metadata-related messages should only be The idea is that all other metadata-related messages should only be
// called either from a request, or from a change. called either from a request, or from a change.
// This shouldn't be sent automatically upon joining a room. This shouldn't be sent automatically upon joining a room.
// Requires: String "chat_id" Requires: String "chat_id"
// Allows: String "chat_name", String "subject", Allows: String "chat_name", String "subject",
// int32 "room_default_flags", int32 "room_disallowed_flags" int32 "room_default_flags", int32 "room_disallowed_flags" */
IM_ROOM_METADATA = 171, IM_ROOM_METADATA = 171,
//! Set the room name →Protocol /*! Set the room name →Protocol
// Requires: String "chat_id", String "chat_name" Requires: String "chat_id", String "chat_name" */
IM_SET_ROOM_NAME = 172, IM_SET_ROOM_NAME = 172,
//! Room name has changed →Protocol /*! Room name has changed →Protocol
// Requires: String "chat_id", String "chat_name" Requires: String "chat_id", String "chat_name" */
IM_ROOM_NAME_SET = 173, IM_ROOM_NAME_SET = 173,
//! Set the room subject →App /*! Set the room subject →App
// Requires: String "chat_id", String "subject" Requires: String "chat_id", String "subject" */
IM_SET_ROOM_SUBJECT = 174, IM_SET_ROOM_SUBJECT = 174,
//! Subject has been changed →App /*! Subject has been changed →App
// Requires: String "chat_id", String "subject" Requires: String "chat_id", String "subject" */
IM_ROOM_SUBJECT_SET = 175, IM_ROOM_SUBJECT_SET = 175,
@ -330,49 +334,50 @@ enum im_what_code {
* Room moderation * Room moderation
*/ */
//! A user's role has been changed →App /*! A user's role has been changed →App
// Requires: String "role_title", int32 "role_perms", int32 "role_priority" Requires: String "role_title", int32 "role_perms",
int32 "role_priority" */
IM_ROOM_ROLECHANGED = 190, IM_ROOM_ROLECHANGED = 190,
//! Kick user →Protocol /*! Kick user →Protocol
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_ROOM_KICK_PARTICIPANT = 191, IM_ROOM_KICK_PARTICIPANT = 191,
//! A user was kicked →App /*! A user was kicked →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id"
// Accepts: String "user_name", String "body" Accepts: String "user_name", String "body" */
IM_ROOM_PARTICIPANT_KICKED = 192, IM_ROOM_PARTICIPANT_KICKED = 192,
//! Ban user →Protocol /*! Ban user →Protocol
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_ROOM_BAN_PARTICIPANT = 193, IM_ROOM_BAN_PARTICIPANT = 193,
//! A user was banned →App /*! A user was banned →App
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id"
// Accepts: String "user_name", String "body" Accepts: String "user_name", String "body" */
IM_ROOM_PARTICIPANT_BANNED = 194, IM_ROOM_PARTICIPANT_BANNED = 194,
//! Unban user →Protocol /*! Unban user →Protocol */
IM_ROOM_UNBAN_PARTICIPANT = 195, IM_ROOM_UNBAN_PARTICIPANT = 195,
//! Mute user →Protocol /*! Mute user →Protocol
// The result of this can be seen with IM_ROOM_ROLECHANGED. The result of this can be seen with IM_ROOM_ROLECHANGED.
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_ROOM_MUTE_PARTICIPANT = 196, IM_ROOM_MUTE_PARTICIPANT = 196,
//! Unmute user →Protocol /*! Unmute user →Protocol
// The result of this can be seen with IM_ROOM_ROLECHANGED. The result of this can be seen with IM_ROOM_ROLECHANGED.
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_ROOM_UNMUTE_PARTICIPANT = 197, IM_ROOM_UNMUTE_PARTICIPANT = 197,
//! Deafen →Protocol /*! Deafen →Protocol
// The result of this can be seen with IM_ROOM_ROLECHANGED. The result of this can be seen with IM_ROOM_ROLECHANGED.
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_ROOM_DEAFEN_PARTICIPANT = 198, IM_ROOM_DEAFEN_PARTICIPANT = 198,
//! Allow to read messages →Protocol /*! Allow to read messages →Protocol
// The result of this can be seen with IM_ROOM_ROLECHANGED. The result of this can be seen with IM_ROOM_ROLECHANGED.
// Requires: String "chat_id", String "user_id" Requires: String "chat_id", String "user_id" */
IM_ROOM_UNDEAFEN_PARTICIPANT = 199, IM_ROOM_UNDEAFEN_PARTICIPANT = 199,