diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-04-15 21:31:52 -0700 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-04-15 21:31:52 -0700 |
commit | cfc8d58f4c15048e943800272017f69804bb61b7 (patch) | |
tree | b777cadc8b97774db995f449a81ed34fe10fe800 /protocols/yahoo/yahoo2_callbacks.h | |
parent | 6bbb939e953bbe1ca9ed3101a1569abe4521f543 (diff) |
Updating the Yahoo! module. This seems to fix handling of incoming away
states/messages, should fix some issues with group chats, and unfortunately
also adds some crap which I don't want to clean up for now.
Diffstat (limited to 'protocols/yahoo/yahoo2_callbacks.h')
-rw-r--r-- | protocols/yahoo/yahoo2_callbacks.h | 229 |
1 files changed, 103 insertions, 126 deletions
diff --git a/protocols/yahoo/yahoo2_callbacks.h b/protocols/yahoo/yahoo2_callbacks.h index 1ab8a9d7..b7f4e99b 100644 --- a/protocols/yahoo/yahoo2_callbacks.h +++ b/protocols/yahoo/yahoo2_callbacks.h @@ -30,7 +30,6 @@ */ - #ifndef YAHOO2_CALLBACKS_H #define YAHOO2_CALLBACKS_H @@ -66,7 +65,6 @@ typedef enum { typedef void (*yahoo_connect_callback)(int fd, int error, void *callback_data); - /* * The following functions need to be implemented in the client * interface. They will be called by the library when each @@ -95,9 +93,7 @@ struct yahoo_callbacks { * succ - enum yahoo_login_status * url - url to reactivate account if locked */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, char *url); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, const char *url); /* @@ -110,8 +106,6 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, char *url); void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies)(int id, YList * buds); - - /* * Name: ext_yahoo_got_ignore * Called when the ignore list is got from the server @@ -122,9 +116,6 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies)(int id, YList * buds); void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore)(int id, YList * igns); - - - /* * Name: ext_yahoo_got_identities * Called when the contact list is got from the server @@ -135,9 +126,6 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore)(int id, YList * igns); void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities)(int id, YList * ids); - - - /* * Name: ext_yahoo_got_cookies * Called when the cookie list is got from the server @@ -147,6 +135,14 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities)(int id, YList * ids); void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies)(int id); +/* + * Name: ext_yahoo_got_ping + * Called when the ping packet is received from the server + * Params: + * id - the id that identifies the server connection + * errormsg - optional error message + */ +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping)(int id, const char *errormsg); /* @@ -158,11 +154,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies)(int id); * stat - status code (enum yahoo_status) * msg - the message if stat == YAHOO_STATUS_CUSTOM * away - whether the contact is away or not (YAHOO_STATUS_CUSTOM) - * for YAHOO_STATUS_IDLE, this is the number of seconds he is idle + * idle - this is the number of seconds he is idle [if he is idle] + * mobile - this is set for mobile users/buddies + * TODO: add support for pager, chat, and game states */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, char *who, int stat, char *msg, int away); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, const char *who, int stat, const char *msg, int away, int idle, int mobile); /* @@ -170,6 +166,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, char *who, int stat, * Called when remote user sends you a message. * Params: * id - the id that identifies the server connection + * me - the identity the message was sent to * who - the handle of the remote user * msg - the message - NULL if stat == 2 * tm - timestamp of message if offline @@ -179,9 +176,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, char *who, int stat, * 5 * utf8 - whether the message is encoded as utf8 or not */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im)(int id, char *who, char *msg, long tm, int stat, int utf8); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im)(int id, const char *me, const char *who, const char *msg, long tm, int stat, int utf8); /* @@ -189,14 +184,13 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im)(int id, char *who, char *msg, long tm * Called when remote user sends you a conference invitation. * Params: * id - the id that identifies the server connection + * me - the identity the invitation was sent to * who - the user inviting you * room - the room to join * msg - the message * members - the initial members of the conference (null terminated list) */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite)(int id, char *who, char *room, char *msg, YList *members); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite)(int id, const char *me, const char *who, const char *room, const char *msg, YList *members); /* @@ -204,13 +198,12 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite)(int id, char *who, char *roo * Called when someone declines to join the conference. * Params: * id - the id that identifies the server connection + * me - the identity in the conference * who - the user who has declined * room - the room * msg - the declining message */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, char *who, char *room, char *msg); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, const char *me, const char *who, const char *room, const char *msg); /* @@ -218,12 +211,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, char *who, char *ro * Called when someone joins the conference. * Params: * id - the id that identifies the server connection + * me - the identity in the conference * who - the user who has joined * room - the room joined */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, char *who, char *room); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, const char *me, const char *who, const char *room); /* @@ -231,33 +223,21 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, char *who, char *room) * Called when someone leaves the conference. * Params: * id - the id that identifies the server connection + * me - the identity in the conference * who - the user who has left * room - the room left */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave)(int id, char *who, char *room); - - - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave)(int id, const char *me, const char *who, const char *room); /* * Name: ext_yahoo_chat_cat_xml - * Called when joining the chatroom. + * Called when ? * Params: * id - the id that identifies the server connection - * room - the room joined, used in all other chat calls, freed by - * library after call - * topic - the topic of the room, freed by library after call - * members - the initial members of the chatroom (null terminated YList of - * yahoo_chat_member's) Must be freed by the client + * xml - ? */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, char *xml); - - - - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, const char *xml); /* @@ -265,6 +245,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, char *xml); * Called when joining the chatroom. * Params: * id - the id that identifies the server connection + * me - the identity in the chatroom * room - the room joined, used in all other chat calls, freed by * library after call * topic - the topic of the room, freed by library after call @@ -272,11 +253,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, char *xml); * of yahoo_chat_member's) Must be freed by the client * fd - the socket where the connection is coming from (for tracking) */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, char *room, char *topic, YList *members, int fd); - - - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, const char *me, const char *room, const char *topic, YList *members, int fd); /* @@ -284,12 +261,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, char *room, char *topic, Y * Called when someone joins the chatroom. * Params: * id - the id that identifies the server connection + * me - the identity in the chatroom * room - the room joined * who - the user who has joined, Must be freed by the client */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, char *room, struct yahoo_chat_member *who); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, const char *me, const char *room, struct yahoo_chat_member *who); /* @@ -297,12 +273,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, char *room, struct yah * Called when someone leaves the chatroom. * Params: * id - the id that identifies the server connection + * me - the identity in the chatroom * room - the room left * who - the user who has left (Just the User ID) */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, char *room, char *who); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, const char *me, const char *room, const char *who); /* @@ -310,6 +285,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, char *room, char *who * Called when someone messages in the chatroom. * Params: * id - the id that identifies the server connection + * me - the identity in the chatroom * room - the room * who - the user who messaged (Just the user id) * msg - the message @@ -317,7 +293,8 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, char *room, char *who * 2 = /me type message * utf8 - whether the message is utf8 encoded or not */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message)(int id, char *who, char *room, char *msg, int msgtype, int utf8); +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message)(int id, const char *me, const char *who, const char *room, const char *msg, int msgtype, int utf8); + /* * @@ -328,10 +305,12 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message)(int id, char *who, char *room, * of the disconnect request before doing anything here (auto-join's etc) * Params: * id - the id that identifies this connection + * me - the identity in the chatroom * Returns: * nothing. */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id); +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id, const char *me); + /* * @@ -343,25 +322,25 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id); * of the error before doing anything about it. * Params: * id - the id that identifies this connection + * me - the identity in the chatroom * Returns: * nothing. */ +void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id, const char *me); -void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id); /* * Name: ext_yahoo_conf_message * Called when someone messages in the conference. * Params: * id - the id that identifies the server connection + * me - the identity the conf message was sent to * who - the user who messaged * room - the room * msg - the message * utf8 - whether the message is utf8 encoded or not */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, char *who, char *room, char *msg, int utf8); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, const char *me, const char *who, const char *room, const char *msg, int utf8); /* @@ -369,6 +348,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, char *who, char *room, * Called when someone sends you a file * Params: * id - the id that identifies the server connection + * me - the identity the file was sent to * who - the user who sent the file * url - the file url * expires - the expiry date of the file on the server (timestamp) @@ -376,9 +356,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, char *who, char *room, * fname- the file name if direct transfer * fsize- the file size if direct transfer */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file)(int id, char *who, char *url, long expires, char *msg, char *fname, unsigned long fesize); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file)(int id, const char *me, const char *who, const char *url, long expires, const char *msg, const char *fname, unsigned long fesize); /* @@ -390,9 +368,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file)(int id, char *who, char *url, long * who - who was added * msg - any message sent */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, char *myid, char *who, char *msg); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, const char *myid, const char *who, const char *msg); /* @@ -403,9 +379,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, char *myid, char *who, * who - who rejected you * msg - any message sent */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, char *who, char *msg); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, const char *who, const char *msg); /* @@ -413,12 +387,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, char *who, char *msg); * Called when remote user starts or stops typing. * Params: * id - the id that identifies the server connection + * me - the handle of the identity the notification is sent to * who - the handle of the remote user * stat - 1 if typing, 0 if stopped typing */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, char *who, int stat); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, const char *me, const char *who, int stat); /* @@ -426,12 +399,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, char *who, int stat); * Called when remote user starts or stops a game. * Params: * id - the id that identifies the server connection + * me - the handle of the identity the notification is sent to * who - the handle of the remote user * stat - 1 if game, 0 if stopped gaming */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, char *who, int stat); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, const char *me, const char *who, int stat); /* @@ -443,9 +415,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, char *who, int stat); * subj - the subject of the mail - NULL if only mail count * cnt - mail count - 0 if new mail notification */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, char *from, char *subj, int cnt); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, const char *from, const char *subj, int cnt); /* @@ -455,17 +425,49 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, char *from, char *subj, * id - the id that identifies the server connection * msg - the message */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message)(int id, char *msg); - - - - - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message)(int id, const char *msg); +/* + * Name: ext_yahoo_got_buddyicon + * Buddy icon received + * Params: + * id - the id that identifies the server connection + * me - the handle of the identity the notification is sent to + * who - the person the buddy icon is for + * url - the url to use to load the icon + * checksum - the checksum of the icon content + */ +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon)(int id, const char *me, const char *who, const char *url, int checksum); +/* + * Name: ext_yahoo_got_buddyicon_checksum + * Buddy icon checksum received + * Params: + * id - the id that identifies the server connection + * me - the handle of the identity the notification is sent to + * who - the yahoo id of the buddy icon checksum is for + * checksum - the checksum of the icon content + */ +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum)(int id, const char *me,const char *who, int checksum); +/* + * Name: ext_yahoo_got_buddyicon_request + * Buddy icon request received + * Params: + * id - the id that identifies the server connection + * me - the handle of the identity the notification is sent to + * who - the yahoo id of the buddy that requested the buddy icon + */ +void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request)(int id, const char *me, const char *who); +/* + * Name: ext_yahoo_got_buddyicon_request + * Buddy icon request received + * Params: + * id - the id that identifies the server connection + * url - remote url, the uploaded buddy icon can be fetched from + */ +void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded)(int id, const char *url); /* * Name: ext_yahoo_got_webcam_image @@ -495,18 +497,15 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_webcam_image)(int id, const char * who, unsigned int timestamp); - - /* * Name: ext_yahoo_webcam_invite * Called when you get a webcam invitation * Params: * id - the id that identifies the server connection + * me - identity the invitation is to * from - who the invitation is from */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, char *from); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, const char *me, const char *from); /* @@ -514,11 +513,11 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, char *from); * Called when you get a response to a webcam invitation * Params: * id - the id that identifies the server connection + * me - identity the invitation response is to * from - who the invitation response is from * accept - 0 (decline), 1 (accept) */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, char *from, int accept); - +void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, const char *me, const char *from, int accept); /* @@ -533,7 +532,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, char *from, int * 3 = user declines permission * 4 = user does not have webcam online */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, char *who, int reason); +void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, const char *who, int reason); /* @@ -551,7 +550,6 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, char *who, int reason) void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result)(int id, int found, int start, int total, YList *contacts); - /* * Name: ext_yahoo_error * Called on error. @@ -559,10 +557,9 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result)(int id, int found, int sta * id - the id that identifies the server connection * err - the error message * fatal- whether this error is fatal to the connection or not + * num - Which error is this */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, char *err, int fatal); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, const char *err, int fatal, int num); /* @@ -573,9 +570,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, char *err, int fatal); * who - the viewer * connect - 0=disconnect 1=connect 2=request */ -void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, char *who, int connect); - - +void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, const char *who, int connect); /* @@ -588,8 +583,6 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, char *who, int connect void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request)(int id, int send); - - /* * Name: ext_yahoo_log * Called to log a message. @@ -598,13 +591,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request)(int id, int send); * Returns: * 0 */ -int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(char *fmt, ...); - - - - - - +int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(const char *fmt, ...); /* @@ -623,8 +610,6 @@ int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(char *fmt, ...); int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler)(int id, int fd, yahoo_input_condition cond, void *data); - - /* * Name: ext_yahoo_remove_handler * Remove the listener for the fd. @@ -635,9 +620,6 @@ int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler)(int id, int fd, yahoo_input_condi void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler)(int id, int tag); - - - /* * Name: ext_yahoo_connect * Connect to a host:port @@ -647,13 +629,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler)(int id, int tag); * Returns: * a unix file descriptor to the socket */ -int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(char *host, int port); - - - - - - +int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(const char *host, int port); /* @@ -674,7 +650,7 @@ int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(char *host, int port); * Returns: * a unix file descriptor to the socket */ -int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async)(int id, char *host, int port, +int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async)(int id, const char *host, int port, yahoo_connect_callback callback, void *callback_data); #ifdef USE_STRUCT_CALLBACKS @@ -685,7 +661,7 @@ int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async)(int id, char *host, int port, * before doing anything else */ void yahoo_register_callbacks(struct yahoo_callbacks * tyc); - + #undef YAHOO_CALLBACK_TYPE #endif @@ -695,3 +671,4 @@ void yahoo_register_callbacks(struct yahoo_callbacks * tyc); #endif #endif + |