From: Christian H. <ch...@us...> - 2002-12-21 19:33:57
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory sc8-pr-cvs1:/tmp/cvs-serv4304/src/protocols/jabber Modified Files: jabber.c Log Message: <Robot101> adds a gc->flag called OPT_CONN_AUTO_RESP so that gc->away can always store the away message even if the prpl doesn't support autoresponding <Robot101> makes all protos correctly free and set gc->away to avoid leaks <Robot101> stores the current away state in gc->away_state whenever gc->away is non-NULL (ie it's not just a plain on-line) <Robot101> also minor change to Jabber to make Chatty an away state, and to Gadu-Gadu to make some other thing an away state too Index: jabber.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jabber.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- jabber.c 21 Dec 2002 05:37:45 -0000 1.81 +++ jabber.c 21 Dec 2002 19:33:53 -0000 1.82 @@ -3313,7 +3313,10 @@ char *chatname; gboolean invisible = FALSE; - gc->away = NULL; /* never send an auto-response */ + if (gc->away) { + g_free(gc->away); + gc->away = NULL; + } x = xmlnode_new_tag("presence"); @@ -3325,7 +3328,7 @@ xmlnode_insert_cdata(y, "away", -1); y = xmlnode_insert_tag(x, "status"); xmlnode_insert_cdata(y, message, -1); - gc->away = ""; + gc->away = g_strdup(message); } else { /* Gaim wants us to not be away */ /* but for Jabber, we can just send presence with no other information. */ @@ -3337,21 +3340,22 @@ } else if (!strcmp(state, "Chatty")) { y = xmlnode_insert_tag(x, "show"); xmlnode_insert_cdata(y, "chat", -1); + gc->away = g_strdup(""); } else if (!strcmp(state, "Away")) { y = xmlnode_insert_tag(x, "show"); xmlnode_insert_cdata(y, "away", -1); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Extended Away")) { y = xmlnode_insert_tag(x, "show"); xmlnode_insert_cdata(y, "xa", -1); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Do Not Disturb")) { y = xmlnode_insert_tag(x, "show"); xmlnode_insert_cdata(y, "dnd", -1); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Invisible")) { xmlnode_put_attrib(x, "type", "invisible"); - gc->away = ""; + gc->away = g_strdup(""); invisible = TRUE; } } |