Reworked msg command to be easier to use. Added group messaging.
This commit is contained in:
+15
-13
@@ -9,28 +9,30 @@ typedef enum {
|
||||
Login,
|
||||
Logout,
|
||||
Hearbeat,
|
||||
List_clients,
|
||||
List,
|
||||
Group,
|
||||
Mute,
|
||||
Unmute,
|
||||
Signal,
|
||||
Inbox
|
||||
} CommandType;
|
||||
} Command_t;
|
||||
|
||||
typedef enum {
|
||||
ACK_ACCEPTED = 0,
|
||||
ACK_DELIVERED,
|
||||
ERR_UNKNOWN_COMMAND,
|
||||
ERR_NOT_LOGGED_IN,
|
||||
ERR_ALREADY_LOGGED_IN,
|
||||
ERR_USER_NOT_FOUND,
|
||||
ERR_USER_MUTED,
|
||||
ERR_INVALID_FORMAT
|
||||
ACK_ACCEPTED = 0,
|
||||
ACK_DELIVERED,
|
||||
ERR_UNKNOWN_COMMAND,
|
||||
ERR_NOT_LOGGED_IN,
|
||||
ERR_ALREADY_LOGGED_IN,
|
||||
ERR_USER_NOT_FOUND,
|
||||
ERR_USER_MUTED,
|
||||
ERR_INVALID_FORMAT
|
||||
} Signal_t;
|
||||
|
||||
typedef struct {
|
||||
CommandType mtype;
|
||||
Signal_t stype; // Used with mtype = signal. Responses from the server - to specify errors or acks
|
||||
char sender[COMMAND_LENGTH]; // Who sent the message
|
||||
Command_t mtype;
|
||||
Signal_t stype; // Used with mtype = signal. Responses from the server - to
|
||||
// specify errors or acks
|
||||
char sender[COMMAND_LENGTH]; // Who sent the message
|
||||
char command[COMMAND_LENGTH]; // Functions as an attribute to mtype -
|
||||
// nicknames, id to send/mute to
|
||||
char message[MESSAGE_LENGTH]; // Actual message content
|
||||
|
||||
Reference in New Issue
Block a user