diff src/protocols/gg/gg.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 c3968c878c68
children 511c2b63caa4
line wrap: on
line diff
--- a/src/protocols/gg/gg.c	Sat Dec 21 05:37:45 2002 +0000
+++ b/src/protocols/gg/gg.c	Sat Dec 21 19:33:54 2002 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 4269 2002-12-11 02:09:43Z lschiere $
+ * $Id: gg.c 4326 2002-12-21 19:33:54Z chipx86 $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * 
@@ -194,32 +194,35 @@
 	struct agg_data *gd = (struct agg_data *)gc->proto_data;
 	int status = gd->own_status;
 
-	if (gc->away)
+	if (gc->away) {
+		g_free(gc->away);
 		gc->away = NULL;
+	}
 
 	if (!g_strcasecmp(state, AGG_STATUS_AVAIL))
 		status = GG_STATUS_AVAIL;
-	else if (!g_strcasecmp(state, AGG_STATUS_AVAIL_FRIENDS))
+	else if (!g_strcasecmp(state, AGG_STATUS_AVAIL_FRIENDS)) {
 		status = GG_STATUS_AVAIL | GG_STATUS_FRIENDS_MASK;
-	else if (!g_strcasecmp(state, AGG_STATUS_BUSY)) {
+		gc->away = g_strdup("");
+	} else if (!g_strcasecmp(state, AGG_STATUS_BUSY)) {
 		status = GG_STATUS_BUSY;
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!g_strcasecmp(state, AGG_STATUS_BUSY_FRIENDS)) {
 		status =  GG_STATUS_BUSY | GG_STATUS_FRIENDS_MASK;
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!g_strcasecmp(state, AGG_STATUS_INVISIBLE)) {
 		status = GG_STATUS_INVISIBLE;
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!g_strcasecmp(state, AGG_STATUS_INVISIBLE_FRIENDS)) {
 		status = GG_STATUS_INVISIBLE | GG_STATUS_FRIENDS_MASK;
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!g_strcasecmp(state, AGG_STATUS_NOT_AVAIL)) {
 		status = GG_STATUS_NOT_AVAIL;
-		gc->away = "";
+		gc->away = g_strdup("");
 	} else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) {
 		if (msg) {
 			status = GG_STATUS_BUSY;
-			gc->away = "";
+			gc->away = g_strdup("");
 		} else
 			status = GG_STATUS_AVAIL;