diff src/protocols/icq/gaim_icq.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 43e396e94095
children 474265997752
line wrap: on
line diff
--- a/src/protocols/icq/gaim_icq.c	Sat Dec 21 05:37:45 2002 +0000
+++ b/src/protocols/icq/gaim_icq.c	Sat Dec 21 19:33:54 2002 +0000
@@ -397,33 +397,35 @@
 static void icq_set_away(struct gaim_connection *gc, char *state, char *msg) {
 	struct icq_data *id = (struct icq_data *)gc->proto_data;
 
-	if (gc->away)
+	if (gc->away) {
+		g_free(gc->away);
 		gc->away = NULL;
+	}
 
 	if (!strcmp(state, "Online"))
 		icq_ChangeStatus(id->link, STATUS_ONLINE);
 	else if (!strcmp(state, "Away")) {
 		icq_ChangeStatus(id->link, STATUS_AWAY);
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!strcmp(state, "Do Not Disturb")) {
 		icq_ChangeStatus(id->link, STATUS_DND);
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!strcmp(state, "Not Available")) {
 		icq_ChangeStatus(id->link, STATUS_NA);
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!strcmp(state, "Occupied")) {
 		icq_ChangeStatus(id->link, STATUS_OCCUPIED);
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!strcmp(state, "Free For Chat")) {
 		icq_ChangeStatus(id->link, STATUS_FREE_CHAT);
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!strcmp(state, "Invisible")) {
 		icq_ChangeStatus(id->link, STATUS_INVISIBLE);
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!strcmp(state, GAIM_AWAY_CUSTOM)) {
 		if (msg) {
 			icq_ChangeStatus(id->link, STATUS_NA);
-			gc->away = "";
+			gc->away = g_strdup("");
 		} else {
 			icq_ChangeStatus(id->link, STATUS_ONLINE);
 		}