From: Sean E. <sea...@us...> - 2002-03-04 04:18:05
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv8126/src Modified Files: conversation.c gaim.h prpl.h server.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: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.330 retrieving revision 1.331 diff -u -d -r1.330 -r1.331 --- conversation.c 3 Mar 2002 23:53:28 -0000 1.330 +++ conversation.c 4 Mar 2002 04:18:02 -0000 1.331 @@ -903,7 +903,7 @@ char *txt = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1); if ((strlen(txt) == 0 && event->keyval < 256 && isprint(event->keyval)) || (c->type_again != 0 && time(NULL) > c->type_again)) { - int timeout = serv_send_typing(c->gc, c->name); + int timeout = serv_send_typing(c->gc, c->name, TRUE); if (timeout) c->type_again = time(NULL) + timeout; else @@ -912,11 +912,11 @@ else if (strlen(txt) == 1) { if ((GTK_OLD_EDITABLE(c->entry)->current_pos == 1 && event->keyval == GDK_BackSpace) || (GTK_OLD_EDITABLE(c->entry)->current_pos == 0 && event->keyval == GDK_Delete)) - serv_send_typing_stopped(c->gc, c->name); + serv_send_typing(c->gc, c->name, FALSE); } else if (GTK_OLD_EDITABLE(c->entry)->selection_start_pos == 0) { if (GTK_OLD_EDITABLE(c->entry)->selection_end_pos == strlen(txt) && (event->keyval == GDK_BackSpace || event->keyval == GDK_Delete)) - serv_send_typing_stopped(c->gc, c->name); + serv_send_typing(c->gc, c->name, FALSE); } g_free(txt); } @@ -2347,7 +2347,6 @@ return FALSE; } /* Reset the title (if necessary) */ - debug_printf("resetting style\n"); if (c->is_chat) { g_free(name); c->typing_timeout = 0; Index: gaim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gaim.h,v retrieving revision 1.308 retrieving revision 1.309 diff -u -d -r1.308 -r1.309 --- gaim.h 2 Mar 2002 04:52:21 -0000 1.308 +++ gaim.h 4 Mar 2002 04:18:02 -0000 1.309 @@ -360,8 +360,7 @@ extern void serv_set_info(struct gaim_connection *, char *); extern void serv_set_away(struct gaim_connection *, char *, char *); extern void serv_set_away_all(char *); -extern int serv_send_typing(struct gaim_connection *, char *); -extern void serv_send_typing_stopped(struct gaim_connection *, char *); +extern int serv_send_typing(struct gaim_connection *, char *, int); extern void serv_change_passwd(struct gaim_connection *, char *, char *); extern void serv_add_buddy(struct gaim_connection *, char *); extern void serv_add_buddies(struct gaim_connection *, GList *); Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- prpl.h 2 Mar 2002 04:52:21 -0000 1.60 +++ prpl.h 4 Mar 2002 04:18:02 -0000 1.61 @@ -104,8 +104,7 @@ void (* close) (struct gaim_connection *); int (* send_im) (struct gaim_connection *, char *who, char *message, int away); void (* set_info) (struct gaim_connection *, char *info); - int (* send_typing) (struct gaim_connection *, char *name); - void (* send_typing_stopped) (struct gaim_connection *, char *name); + int (* send_typing) (struct gaim_connection *, char *name, int typing); void (* get_info) (struct gaim_connection *, char *who); void (* set_away) (struct gaim_connection *, char *state, char *message); void (* get_away) (struct gaim_connection *, char *who); Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.219 retrieving revision 1.220 diff -u -d -r1.219 -r1.220 --- server.c 2 Mar 2002 04:52:21 -0000 1.219 +++ server.c 4 Mar 2002 04:18:02 -0000 1.220 @@ -144,18 +144,14 @@ /* This should return the elapsed time in seconds in which Gaim will not send * typing notifications. - * if it returns zero, it will not send any more typing notifications */ -int serv_send_typing(struct gaim_connection *g, char *name) { + * if it returns zero, it will not send any more typing notifications + * typing is a flag - TRUE for typing, FALSE for stopped typing */ +int serv_send_typing(struct gaim_connection *g, char *name, int typing) { if (g && g->prpl && g->prpl->send_typing) - return g->prpl->send_typing(g, name); + return g->prpl->send_typing(g, name, typing); else return 0; } -void serv_send_typing_stopped(struct gaim_connection *g, char *name) { - if (g && g->prpl && g->prpl->send_typing_stopped) - g->prpl->send_typing_stopped(g, name); -} - int serv_send_im(struct gaim_connection *gc, char *name, char *message, int flags) { int val = -EINVAL; @@ -165,7 +161,7 @@ if (!(flags & IM_FLAG_AWAY)) serv_touch_idle(gc); - serv_send_typing_stopped(gc, name); + serv_send_typing(gc, name, FALSE); return val; } |