From: Sean E. <sea...@us...> - 2002-03-04 04:18:06
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv8126/src/protocols/yahoo Modified Files: yahoo.c Log Message: Improved typing notification for Yahoo so that it sends and recieves notification that the user has stopped typing. Also, combined serv_send_typing and serv_send_typing_stopped... expect the same with serv_got_typing_stopped. Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- yahoo.c 2 Mar 2002 04:52:21 -0000 1.33 +++ yahoo.c 4 Mar 2002 04:18:02 -0000 1.34 @@ -57,11 +57,6 @@ #define USEROPT_PAGERPORT 4 #define YAHOO_PAGER_PORT 5050 -/* I just made these values up. Anyone know what they should be? - * -SeanEgan */ -#define YAHOO_TYPING_RECV_TIMEOUT 10 -#define YAHOO_TYPING_SEND_TIMEOUT 8 - enum yahoo_service { /* these are easier to see in hex */ YAHOO_SERVICE_LOGON = 1, YAHOO_SERVICE_LOGOFF, @@ -470,7 +465,7 @@ { char *msg = NULL; char *from = NULL; - time_t tm = time(0); + char *typing = NULL; GSList *l = pkt->hash; while (l) { @@ -479,9 +474,14 @@ from = pair->value; if (pair->key == 49) msg = pair->value; + if (pair->key == 13) + typing = pair->value; l = l->next; } - serv_got_typing(gc, from, YAHOO_TYPING_RECV_TIMEOUT); + if (*typing == '1') + serv_got_typing(gc, from, 0); + else + serv_got_typing_stopped(gc, from); } static void yahoo_process_message(struct gaim_connection *gc, struct yahoo_packet *pkt) @@ -914,7 +914,7 @@ return 1; } -int yahoo_send_typing(struct gaim_connection *gc, char *who) +int yahoo_send_typing(struct gaim_connection *gc, char *who, int typ) { struct yahoo_data *yd = gc->proto_data; struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_TYPING, YAHOO_STATUS_TYPING, 0);//x6431de4f); @@ -922,7 +922,7 @@ yahoo_packet_hash(pkt, 49, "TYPING"); yahoo_packet_hash(pkt, 1, gc->displayname); yahoo_packet_hash(pkt, 14, " "); - yahoo_packet_hash(pkt, 13, "1"); + yahoo_packet_hash(pkt, 13, typ ? "1" : "0"); yahoo_packet_hash(pkt, 5, who); yahoo_packet_hash(pkt, 1002, "1"); @@ -930,7 +930,7 @@ yahoo_packet_free(pkt); - return YAHOO_TYPING_SEND_TIMEOUT; + return 0; } static void yahoo_set_away(struct gaim_connection *gc, char *state, char *msg) |