Mercurial > pidgin
diff src/protocols/oscar/oscar.c @ 4111:ee884f1d7ae3
[gaim-migrate @ 4326]
<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
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 21 Dec 2002 19:33:54 +0000 |
| parents | c5ce82228a2f |
| children | 697217b52ebd |
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c Sat Dec 21 05:37:45 2002 +0000 +++ b/src/protocols/oscar/oscar.c Sat Dec 21 19:33:54 2002 +0000 @@ -626,6 +626,7 @@ } else { gc->protocol = PROTO_TOC; gc->flags |= OPT_CONN_HTML; + gc->flags |= OPT_CONN_AUTO_RESP; } odata->supports_tn = g_hash_table_new(g_str_hash, g_str_equal); @@ -3634,9 +3635,10 @@ _("You have probably requested to set your away message before the login procedure completed. " "You remain in a \"present\" state; try setting it again when you are fully connected."), GAIM_ERROR); - if (gc->away) + if (gc->away) { g_free(gc->away); - gc->away = NULL; + gc->away = NULL; + } if (!message) { aim_bos_setprofile(od->sess, od->conn, NULL, "", caps_aim); @@ -3661,33 +3663,35 @@ static void oscar_set_away_icq(struct gaim_connection *gc, struct oscar_data *od, const char *state, const char *message) { - if (gc->away) + if (gc->away) { + g_free(gc->away); gc->away = NULL; + } if (!strcmp(state, "Online")) aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); else if (!strcmp(state, "Away")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Do Not Disturb")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Not Available")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Occupied")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Free For Chat")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, "Invisible")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); - gc->away = ""; + gc->away = g_strdup(""); } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { if (message) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); - gc->away = ""; + gc->away = g_strdup(""); } else { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); }
