my_teams
logging_client.h
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, XXXX
3 ** NWP_myteams_XXXX
4 ** File description:
5 ** a file containing libs functions that should be called in myteams_cli
6 */
7 
8 #ifndef LIB_MYTEAMS_LOGGING_CLIENT_H
9 #define LIB_MYTEAMS_LOGGING_CLIENT_H
10 
11 #include <time.h>
12 
13 /*
14 ** The functions that have event in their name are called when you receive
15 ** something from the server, when it is not you who initiated the action.
16 **
17 ** The other functions are called in response to one of your action.
18 **
19 ** Ex: I received a private message (I did nothing to do so) so the function
20 ** to call is one with event in it's name.
21 ** Ex: I asked the server to join a team (I initiated this action) so the
22 ** function to call is one that does not have event in it's name.
23 */
24 
25 /*
26 ** To receive teams related events you MUST be logged in
27 */
28 
29 /*
30 ** To receive team related events you MUST be subscribed to the team
31 ** Ex: to receive client_event_thread_reply_received you must be subscribed to
32 ** the team, that have the channel, that have the thread, that got the new reply
33 */
34 
35 /*
36 ** To get team information or team modifications (list threads, create reply...)
37 ** you MUST be subscribed to the team.
38 */
39 
49 int client_event_logged_in(char const *user_uuid, const char *user_name);
50 
60 int client_event_logged_out(char const *user_uuid, const char *user_name);
61 
71  char const *user_uuid,
72  char const *message_body);
73 
85  char const *team_uuid,
86  char const *thread_uuid,
87  char const *user_uuid,
88  char const *reply_body);
89 
101  char const *team_uuid,
102  char const *team_name,
103  char const *team_description);
104 
115  char const *channel_uuid,
116  char const *channel_name,
117  char const *channel_description);
118 
131  char const *thread_uuid,
132  char const *user_uuid,
133  time_t thread_timestamp,
134  char const *thread_title,
135  char const *thread_body);
136 
152  char const *user_uuid,
153  char const *user_name,
154  int user_status);
155 
170  char const *team_uuid,
171  char const *team_name,
172  char const *team_description);
173 
187  char const *channel_uuid,
188  char const *channel_name,
189  char const *channel_description);
190 
206  char const *thread_uuid,
207  char const *user_uuid,
208  time_t thread_timestamp,
209  char const *thread_title,
210  char const *thread_body);
211 
226  char const *thread_uuid,
227  char const *user_uuid,
228  time_t reply_timestamp,
229  char const *reply_body);
230 
244  char const *sender_uuid,
245  time_t message_timestamp,
246  char const *message_body);
247 
263 int client_error_unknown_team(char const *team_uuid);
264 
276 int client_error_unknown_channel(char const *channel_uuid);
277 
288 int client_error_unknown_thread(char const *thread_uuid);
289 
300 int client_error_unknown_user(char const *user_uuid);
301 
312 
325 
338  char const *user_uuid,
339  char const *user_name,
340  int user_status);
341 
353  char const *team_uuid,
354  char const *team_name,
355  char const *team_description);
356 
368  char const *channel_uuid,
369  char const *channel_name,
370  char const *channel_description);
371 
385  char const *thread_uuid,
386  char const *user_uuid,
387  time_t thread_timestamp,
388  char const *thread_title,
389  char const *thread_body);
390 
401  char const *team_uuid,
402  char const *team_name,
403  char const *team_description);
404 
415  char const *channel_uuid,
416  char const *channel_name,
417  char const *channel_description);
418 
431  char const *thread_uuid,
432  char const *user_uuid,
433  time_t thread_timestamp,
434  char const *thread_title,
435  char const *thread_body);
436 
448  char const *thread_uuid,
449  char const *user_uuid,
450  time_t reply_timestamp,
451  char const *reply_body);
452 
461 int client_print_subscribed(char const *user_uuid, char const *team_uuid);
462 
471 int client_print_unsubscribed(char const *user_uuid, char const *team_uuid);
472 
473 #endif /* LIB_MYTEAMS_LOGGING_CLIENT_H */
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.
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.
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.
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.
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 sho...
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.
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 subscr...
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...
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 sh...
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,...
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.
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 messag...
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 u...
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.
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.
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...
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.
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.
int client_print_unsubscribed(char const *user_uuid, char const *team_uuid)
Must be called when you unsubscribe from a team successfully.
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.
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,...
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 chann...
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 wi...
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,...
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,...
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 tea...
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 threa...
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 ...
int client_print_subscribed(char const *user_uuid, char const *team_uuid)
Must be called when you subscribe to a team successfully.