Index: protocols/yahoo/yahoo2_callbacks.h
===================================================================
--- protocols/yahoo/yahoo2_callbacks.h	(revision b7d3cc34f68dab7b8f7d0777711317b334fc2219)
+++ protocols/yahoo/yahoo2_callbacks.h	(revision b3cae44de28b62a282f2ba32260048174abc83e7)
@@ -29,5 +29,4 @@
  * declared in this file and defined in libyahoo2.c
  */
-
 
 
@@ -67,5 +66,4 @@
 
 
-
 /*
  * The following functions need to be implemented in the client
@@ -96,7 +94,5 @@
  * 	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);
 
 
@@ -111,6 +107,4 @@
 
 
-
-
 /*
  * Name: ext_yahoo_got_ignore
@@ -123,7 +117,4 @@
 
 
-
-
-
 /*
  * Name: ext_yahoo_got_identities
@@ -136,7 +127,4 @@
 
 
-
-
-
 /*
  * Name: ext_yahoo_got_cookies
@@ -148,4 +136,12 @@
 
 
+/*
+ * 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);
 
 
@@ -159,9 +155,9 @@
  * 	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
- */
-void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, char *who, int stat, char *msg, int away);
-
-
+ * 	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, const char *who, int stat, const char *msg, int away, int idle, int mobile);
 
 
@@ -171,4 +167,5 @@
  * 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
@@ -180,7 +177,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);
 
 
@@ -190,4 +185,5 @@
  * 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
@@ -195,7 +191,5 @@
  *	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);
 
 
@@ -205,11 +199,10 @@
  * 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);
 
 
@@ -219,10 +212,9 @@
  * 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);
 
 
@@ -232,31 +224,19 @@
  * 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
- */
-void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, char *xml);
-
-
-
-
-
+ * 	xml     - ?
+ */
+void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, const char *xml);
 
 
@@ -266,4 +246,5 @@
  * 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
@@ -273,9 +254,5 @@
  *	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);
 
 
@@ -285,10 +262,9 @@
  * 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);
 
 
@@ -298,10 +274,9 @@
  * 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);
 
 
@@ -311,4 +286,5 @@
  * 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)
@@ -318,5 +294,6 @@
  * 	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);
+
 
 /*
@@ -329,8 +306,10 @@
  * 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);
+
 
 /*
@@ -344,9 +323,10 @@
  * 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);
+void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id, const char *me);
+
 
 /*
@@ -355,4 +335,5 @@
  * 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
@@ -360,7 +341,5 @@
  * 	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);
 
 
@@ -370,4 +349,5 @@
  * 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
@@ -377,7 +357,5 @@
  * 	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);
 
 
@@ -391,7 +369,5 @@
  * 	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);
 
 
@@ -404,7 +380,5 @@
  * 	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);
 
 
@@ -414,10 +388,9 @@
  * 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);
 
 
@@ -427,10 +400,9 @@
  * 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);
 
 
@@ -444,7 +416,5 @@
  * 	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);
 
 
@@ -456,15 +426,47 @@
  * 	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);
 
 /*
@@ -496,6 +498,4 @@
 
 
-
-
 /*
  * Name: ext_yahoo_webcam_invite
@@ -503,9 +503,8 @@
  * 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);
 
 
@@ -515,9 +514,9 @@
  * 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);
 
 
@@ -534,5 +533,5 @@
  *	         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);
 
 
@@ -552,5 +551,4 @@
 
 
-
 /*
  * Name: ext_yahoo_error
@@ -560,8 +558,7 @@
  * 	err  - the error message
  * 	fatal- whether this error is fatal to the connection or not
- */
-void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, char *err, int fatal);
-
-
+ * 	num  - Which error is this
+ */
+void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, const char *err, int fatal, int num);
 
 
@@ -574,7 +571,5 @@
  *	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);
 
 
@@ -587,6 +582,4 @@
  */
 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request)(int id, int send);
-
-
 
 
@@ -599,11 +592,5 @@
  * 	0
  */
-int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(char *fmt, ...);
-
-
-
-
-
-
+int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(const char *fmt, ...);
 
 
@@ -624,6 +611,4 @@
 
 
-
-
 /*
  * Name: ext_yahoo_remove_handler
@@ -634,7 +619,4 @@
  */
 void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler)(int id, int tag);
-
-
-
 
 
@@ -648,11 +630,5 @@
  * 	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);
 
 
@@ -675,5 +651,5 @@
  * 	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);
 
@@ -686,5 +662,5 @@
  */
 void yahoo_register_callbacks(struct yahoo_callbacks * tyc);
-	
+
 #undef YAHOO_CALLBACK_TYPE
 
@@ -696,2 +672,3 @@
 
 #endif
+
