my_teams
logging_client.h File Reference
#include <time.h>
Include dependency graph for logging_client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int client_event_logged_in (char const *user_uuid, const char *user_name)
 Must be called when a user successfully login to the server (/login). When you log in (/login) you should also receive from the server this event. More...
 
int client_event_logged_out (char const *user_uuid, const char *user_name)
 Must be called when a user logged out (/logout or lost connexion). When you log out (/logout) you should also receive the event before quitting. More...
 
int client_event_private_message_received (char const *user_uuid, char const *message_body)
 Must be called when the current logged user receives a private message. More...
 
int client_event_thread_reply_received (char const *team_uuid, char const *thread_uuid, char const *user_uuid, char const *reply_body)
 Must be called when a new reply is posted in a thread. More...
 
int client_event_team_created (char const *team_uuid, char const *team_name, char const *team_description)
 Must be called when a new team is created Every logged user should receive this event (the creator of the team too) More...
 
int client_event_channel_created (char const *channel_uuid, char const *channel_name, char const *channel_description)
 Must be called when a channel is created inside of a team. More...
 
int client_event_thread_created (char const *thread_uuid, char const *user_uuid, time_t thread_timestamp, char const *thread_title, char const *thread_body)
 Must be called when a thread is created inside of a channel. More...
 
int client_print_users (char const *user_uuid, char const *user_name, int user_status)
 Must be called when you requested a list of users from the server ex: asking the subscribed users to a team / the list of users in a domain This function should be called once per user in the list This function should be called even if the list only has one entry. More...
 
int client_print_teams (char const *team_uuid, char const *team_name, char const *team_description)
 Must be called when you requested a list of teams from the server ex: asking the teams you are subscribed to or the available teams in a domain This function should be called once per team in the list This function should be called even if the list only has one entry. More...
 
int client_team_print_channels (char const *channel_uuid, char const *channel_name, char const *channel_description)
 Must be called when you requested a list of channels from the server ex: asking the channels in a team This function should be called one per channel in the list This function should be called even if the list only has one entry. More...
 
int client_channel_print_threads (char const *thread_uuid, char const *user_uuid, time_t thread_timestamp, char const *thread_title, char const *thread_body)
 Must be called when you requested a list of threads from the server ex: asking the threads in a channel This function should be called one per thread in the list This function should be called even if the list only has one entry. More...
 
int client_thread_print_replies (char const *thread_uuid, char const *user_uuid, time_t reply_timestamp, char const *reply_body)
 Must be called when you requested a list of replies from the server ex: asking the replies in a thread This function should be called one per reply in the list This function should be called even if the list only has one entry. More...
 
int client_private_message_print_messages (char const *sender_uuid, time_t message_timestamp, char const *message_body)
 Must be called when you requested a list of private messages ex: asking the private messages with a user This function should be called one per private message in the list This function should be called even if the list only has one entry. More...
 
int client_error_unknown_team (char const *team_uuid)
 Must be called when the user try to do an action with a team that does not exist (list channels, subscribe, etc...) More...
 
int client_error_unknown_channel (char const *channel_uuid)
 Must be called when the user try to do an action with a channel that does not exist (list threads, create thread, etc...) More...
 
int client_error_unknown_thread (char const *thread_uuid)
 Must be called when the user try to do an action with a thread that does not exist (list replies, create reply, etc...) More...
 
int client_error_unknown_user (char const *user_uuid)
 Must be called when the user try to do an action with a user that does not exist (send private message, /user) More...
 
int client_error_unauthorized (void)
 Must be called when the user try to do an action he is not allowed to perform. Ex: create a thread in a team he is not subscribed Ex: create a team when he is not logged in. More...
 
int client_error_already_exist (void)
 Must be called when the user try to do an action and the resource already exist. Ex: create a team with a name that already exist This error based itself on the name/title of the object created. More...
 
int client_print_user (char const *user_uuid, char const *user_name, int user_status)
 Must be called when you requested an individual user ex: get the current logged user, get information about a user. More...
 
int client_print_team (char const *team_uuid, char const *team_name, char const *team_description)
 Must be called when you requested an individual team ex: get the current used team. More...
 
int client_print_channel (char const *channel_uuid, char const *channel_name, char const *channel_description)
 Must be called when you requested an individual channel ex: get the current used channel. More...
 
int client_print_thread (char const *thread_uuid, char const *user_uuid, time_t thread_timestamp, char const *thread_title, char const *thread_body)
 Must be called when you requested an individual thread ex: get the current used thread. More...
 
int client_print_team_created (char const *team_uuid, char const *team_name, char const *team_description)
 Must be called when you create a team successfully. More...
 
int client_print_channel_created (char const *channel_uuid, char const *channel_name, char const *channel_description)
 Must be called when you create channel successfully. More...
 
int client_print_thread_created (char const *thread_uuid, char const *user_uuid, time_t thread_timestamp, char const *thread_title, char const *thread_body)
 Must be called when you create a thread successfully. More...
 
int client_print_reply_created (char const *thread_uuid, char const *user_uuid, time_t reply_timestamp, char const *reply_body)
 Must be called when you create a reply successfully. More...
 
int client_print_subscribed (char const *user_uuid, char const *team_uuid)
 Must be called when you subscribe to a team successfully. More...
 
int client_print_unsubscribed (char const *user_uuid, char const *team_uuid)
 Must be called when you unsubscribe from a team successfully. More...
 

Function Documentation

◆ client_channel_print_threads()

int client_channel_print_threads ( char const *  thread_uuid,
char const *  user_uuid,
time_t  thread_timestamp,
char const *  thread_title,
char const *  thread_body 
)

Must be called when you requested a list of threads from the server ex: asking the threads in a channel This function should be called one per thread in the list This function should be called even if the list only has one entry.

Parameters
thread_uuidThe id of a thread
user_uuidThe id of the user who created a thread
thread_timestampThe unix timestamp of a thread creation
thread_titleThe title of a thread
thread_bodyThe body of a thread

Commands: /list

◆ client_error_already_exist()

int client_error_already_exist ( void  )

Must be called when the user try to do an action and the resource already exist. Ex: create a team with a name that already exist This error based itself on the name/title of the object created.

Commands: /create "team_name" "team_description" /create "channel_name" "channel_description" /create "thread_title" "thread_body"

◆ client_error_unauthorized()

int client_error_unauthorized ( void  )

Must be called when the user try to do an action he is not allowed to perform. Ex: create a thread in a team he is not subscribed Ex: create a team when he is not logged in.

Commands: Everything except /login

◆ client_error_unknown_channel()

int client_error_unknown_channel ( char const *  channel_uuid)

Must be called when the user try to do an action with a channel that does not exist (list threads, create thread, etc...)

Parameters
channel_uuidThe id that was given and does not exist

Commands: /list /create "thread_title" "thread_body" /create "reply_body" /info

◆ client_error_unknown_team()

int client_error_unknown_team ( char const *  team_uuid)

Must be called when the user try to do an action with a team that does not exist (list channels, subscribe, etc...)

Parameters
team_uuidThe id that was given and does not exist

Commands: /subscribe "team_uuid" /unsubscribe "team_uuid" /subscribed "team_uuid" /list /create "channel_name" "channel_description" /create "thread_title" "thread_body" /create "reply_body" /info

◆ client_error_unknown_thread()

int client_error_unknown_thread ( char const *  thread_uuid)

Must be called when the user try to do an action with a thread that does not exist (list replies, create reply, etc...)

Parameters
thread_uuidThe id that was given and does not exist

Commands: /list /create "reply_body" /info

◆ client_error_unknown_user()

int client_error_unknown_user ( char const *  user_uuid)

Must be called when the user try to do an action with a user that does not exist (send private message, /user)

Parameters
user_uuidThe id that was given and does not exist

Commands: /send "user_uuid" "message_body" /user "user_uuid" /messages "user_uuid"

◆ client_event_channel_created()

int client_event_channel_created ( char const *  channel_uuid,
char const *  channel_name,
char const *  channel_description 
)

Must be called when a channel is created inside of a team.

Parameters
channel_uuidThe id of the created channel
channel_nameThe name of the created channel
channel_descriptionThe description of the created channel

Commands: /create "channel_name" "channel_description"

◆ client_event_logged_in()

int client_event_logged_in ( char const *  user_uuid,
const char *  user_name 
)

Must be called when a user successfully login to the server (/login). When you log in (/login) you should also receive from the server this event.

Parameters
user_uuidThe id of the user who logged in
user_nameThe name of the user who logged in

Commands: /login "user_name"

◆ client_event_logged_out()

int client_event_logged_out ( char const *  user_uuid,
const char *  user_name 
)

Must be called when a user logged out (/logout or lost connexion). When you log out (/logout) you should also receive the event before quitting.

Parameters
user_uuidThe id of the user who logged out
user_nameThe name of the user who logged out

Commands: /logout

◆ client_event_private_message_received()

int client_event_private_message_received ( char const *  user_uuid,
char const *  message_body 
)

Must be called when the current logged user receives a private message.

Parameters
user_uuidThe id of the user that sent the private message
message_bodyThe body of the private message

Commands: /send "user_uuid" "message_body"

◆ client_event_team_created()

int client_event_team_created ( char const *  team_uuid,
char const *  team_name,
char const *  team_description 
)

Must be called when a new team is created Every logged user should receive this event (the creator of the team too)

Parameters
team_uuidThe id of the created team
team_nameThe name of the created team
team_descriptionThe description of the created team

Commands: /create "team_name" "team_description"

◆ client_event_thread_created()

int client_event_thread_created ( char const *  thread_uuid,
char const *  user_uuid,
time_t  thread_timestamp,
char const *  thread_title,
char const *  thread_body 
)

Must be called when a thread is created inside of a channel.

Parameters
thread_uuidThe id of the created thread
user_uuidThe id of the user who created the thread
thread_timestampThe unix timestamp of the thread creation
thread_titleThe title of the created thread
thread_bodyThe body of the created thread

Commands: /create "thread_title" "thread_body"

◆ client_event_thread_reply_received()

int client_event_thread_reply_received ( char const *  team_uuid,
char const *  thread_uuid,
char const *  user_uuid,
char const *  reply_body 
)

Must be called when a new reply is posted in a thread.

Parameters
team_uuidThe id of the team this reply is in
thread_uuidThe id of the thread this reply is in
user_uuidThe id of the user that created the reply
reply_bodyThe reply body

Commands: /create "reply_body"

◆ client_print_channel()

int client_print_channel ( char const *  channel_uuid,
char const *  channel_name,
char const *  channel_description 
)

Must be called when you requested an individual channel ex: get the current used channel.

Parameters
channel_uuidThe id of the channel
channel_nameThe name of the channel
channel_descriptionThe description of the channel

Commands: /info

◆ client_print_channel_created()

int client_print_channel_created ( char const *  channel_uuid,
char const *  channel_name,
char const *  channel_description 
)

Must be called when you create channel successfully.

Parameters
channel_uuidThe id of the channel that was created
channel_nameThe name of the channel that was created
channel_descriptionThe description of the channel that was created

Commands: /create "channel_name" "channel_description"

◆ client_print_reply_created()

int client_print_reply_created ( char const *  thread_uuid,
char const *  user_uuid,
time_t  reply_timestamp,
char const *  reply_body 
)

Must be called when you create a reply successfully.

Parameters
thread_uuidThe id of the thread this reply was created in
user_uuidThe id of the user who created the reply
reply_timestampThe unix timestamp of the created reply
reply_bodyThe body of the created reply

Commands: /create "reply_body"

◆ client_print_subscribed()

int client_print_subscribed ( char const *  user_uuid,
char const *  team_uuid 
)

Must be called when you subscribe to a team successfully.

Parameters
user_uuidThe id of the user who subscribed to the team
team_uuidThe id of the team the user subscribed to

Commands: /subscribe "team_uuid"

◆ client_print_team()

int client_print_team ( char const *  team_uuid,
char const *  team_name,
char const *  team_description 
)

Must be called when you requested an individual team ex: get the current used team.

Parameters
team_uuidThe id of the team
team_nameThe name of the team
team_descriptionThe description of the team

Commands: /info

◆ client_print_team_created()

int client_print_team_created ( char const *  team_uuid,
char const *  team_name,
char const *  team_description 
)

Must be called when you create a team successfully.

Parameters
team_uuidThe id of the team that was created
team_nameThe name of the team that was created
team_descriptionThe description of the team that was created

Commands: /create "team_name" "team_description"

◆ client_print_teams()

int client_print_teams ( char const *  team_uuid,
char const *  team_name,
char const *  team_description 
)

Must be called when you requested a list of teams from the server ex: asking the teams you are subscribed to or the available teams in a domain This function should be called once per team in the list This function should be called even if the list only has one entry.

Parameters
team_uuidThe id of a team
team_nameThe name of a team
team_descriptionThe description of a team

Commands: /list /subscribed

◆ client_print_thread()

int client_print_thread ( char const *  thread_uuid,
char const *  user_uuid,
time_t  thread_timestamp,
char const *  thread_title,
char const *  thread_body 
)

Must be called when you requested an individual thread ex: get the current used thread.

Parameters
thread_uuidThe id of the thread
user_uuidThe id of the user who created the thread
thread_timestampThe unix timestamp of the creation of the thread
thread_titleThe title of the thread
thread_bodyThe body of the thread

Commands: /info

◆ client_print_thread_created()

int client_print_thread_created ( char const *  thread_uuid,
char const *  user_uuid,
time_t  thread_timestamp,
char const *  thread_title,
char const *  thread_body 
)

Must be called when you create a thread successfully.

Parameters
thread_uuidThe id of the thread that was created
user_uuidThe id of the user who created the thread
thread_timestampThe unix timestamp of the thread creation
thread_titleThe title of the thread that was created
thread_bodyThe body of the thread that was created

Commands: /create "thread_title" "thread_body"

◆ client_print_unsubscribed()

int client_print_unsubscribed ( char const *  user_uuid,
char const *  team_uuid 
)

Must be called when you unsubscribe from a team successfully.

Parameters
user_uuidThe id of the user who unsubscribed from the team
team_uuidThe id of the team the user unsubscribed from

Commands: /unsubscribe "team_uuid"

◆ client_print_user()

int client_print_user ( char const *  user_uuid,
char const *  user_name,
int  user_status 
)

Must be called when you requested an individual user ex: get the current logged user, get information about a user.

Parameters
user_uuidThe id of the user
user_nameThe name of the user
user_statusThe status of the user (0: not connected; 1: connected)

Commands: /user "user_uuid" /info

◆ client_print_users()

int client_print_users ( char const *  user_uuid,
char const *  user_name,
int  user_status 
)

Must be called when you requested a list of users from the server ex: asking the subscribed users to a team / the list of users in a domain This function should be called once per user in the list This function should be called even if the list only has one entry.

Parameters
user_uuidThe id of a user
user_nameThe name of a user
user_statusThe status of a user (0: not connected; 1: connected) user_status is NOT the number of simultaneous connexion of a user

Commands: /users /subscribed "team_uuid"

◆ client_private_message_print_messages()

int client_private_message_print_messages ( char const *  sender_uuid,
time_t  message_timestamp,
char const *  message_body 
)

Must be called when you requested a list of private messages ex: asking the private messages with a user This function should be called one per private message in the list This function should be called even if the list only has one entry.

Parameters
sender_uuidThe id of the user who sent a private message
message_timestampThe unix timestamp of a private message creation
message_bodyThe content of a private message

Commands: /messages "user_uuid"

◆ client_team_print_channels()

int client_team_print_channels ( char const *  channel_uuid,
char const *  channel_name,
char const *  channel_description 
)

Must be called when you requested a list of channels from the server ex: asking the channels in a team This function should be called one per channel in the list This function should be called even if the list only has one entry.

Parameters
channel_uuidThe id of a channel
channel_nameThe name of a channel
channel_descriptionThe description of a channel

Commands: /list

◆ client_thread_print_replies()

int client_thread_print_replies ( char const *  thread_uuid,
char const *  user_uuid,
time_t  reply_timestamp,
char const *  reply_body 
)

Must be called when you requested a list of replies from the server ex: asking the replies in a thread This function should be called one per reply in the list This function should be called even if the list only has one entry.

Parameters
thread_uuidThe id of the thread a reply belongs to
user_uuidThe id of the user who created a reply
reply_timestampThe unix timestamp of a reply creation
reply_bodyThe body of a reply

Commands: /list