Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
4110:64d983d6b7bb | 4111:ee884f1d7ae3 |
---|---|
1 /* | 1 /* |
2 * gaim - Gadu-Gadu Protocol Plugin | 2 * gaim - Gadu-Gadu Protocol Plugin |
3 * $Id: gg.c 4269 2002-12-11 02:09:43Z lschiere $ | 3 * $Id: gg.c 4326 2002-12-21 19:33:54Z chipx86 $ |
4 * | 4 * |
5 * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> | 5 * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> |
6 * | 6 * |
7 * This program is free software; you can redistribute it and/or modify | 7 * This program is free software; you can redistribute it and/or modify |
8 * it under the terms of the GNU General Public License as published by | 8 * it under the terms of the GNU General Public License as published by |
192 static void agg_set_away(struct gaim_connection *gc, char *state, char *msg) | 192 static void agg_set_away(struct gaim_connection *gc, char *state, char *msg) |
193 { | 193 { |
194 struct agg_data *gd = (struct agg_data *)gc->proto_data; | 194 struct agg_data *gd = (struct agg_data *)gc->proto_data; |
195 int status = gd->own_status; | 195 int status = gd->own_status; |
196 | 196 |
197 if (gc->away) | 197 if (gc->away) { |
198 g_free(gc->away); | |
198 gc->away = NULL; | 199 gc->away = NULL; |
200 } | |
199 | 201 |
200 if (!g_strcasecmp(state, AGG_STATUS_AVAIL)) | 202 if (!g_strcasecmp(state, AGG_STATUS_AVAIL)) |
201 status = GG_STATUS_AVAIL; | 203 status = GG_STATUS_AVAIL; |
202 else if (!g_strcasecmp(state, AGG_STATUS_AVAIL_FRIENDS)) | 204 else if (!g_strcasecmp(state, AGG_STATUS_AVAIL_FRIENDS)) { |
203 status = GG_STATUS_AVAIL | GG_STATUS_FRIENDS_MASK; | 205 status = GG_STATUS_AVAIL | GG_STATUS_FRIENDS_MASK; |
204 else if (!g_strcasecmp(state, AGG_STATUS_BUSY)) { | 206 gc->away = g_strdup(""); |
207 } else if (!g_strcasecmp(state, AGG_STATUS_BUSY)) { | |
205 status = GG_STATUS_BUSY; | 208 status = GG_STATUS_BUSY; |
206 gc->away = ""; | 209 gc->away = g_strdup(""); |
207 } else if (!g_strcasecmp(state, AGG_STATUS_BUSY_FRIENDS)) { | 210 } else if (!g_strcasecmp(state, AGG_STATUS_BUSY_FRIENDS)) { |
208 status = GG_STATUS_BUSY | GG_STATUS_FRIENDS_MASK; | 211 status = GG_STATUS_BUSY | GG_STATUS_FRIENDS_MASK; |
209 gc->away = ""; | 212 gc->away = g_strdup(""); |
210 } else if (!g_strcasecmp(state, AGG_STATUS_INVISIBLE)) { | 213 } else if (!g_strcasecmp(state, AGG_STATUS_INVISIBLE)) { |
211 status = GG_STATUS_INVISIBLE; | 214 status = GG_STATUS_INVISIBLE; |
212 gc->away = ""; | 215 gc->away = g_strdup(""); |
213 } else if (!g_strcasecmp(state, AGG_STATUS_INVISIBLE_FRIENDS)) { | 216 } else if (!g_strcasecmp(state, AGG_STATUS_INVISIBLE_FRIENDS)) { |
214 status = GG_STATUS_INVISIBLE | GG_STATUS_FRIENDS_MASK; | 217 status = GG_STATUS_INVISIBLE | GG_STATUS_FRIENDS_MASK; |
215 gc->away = ""; | 218 gc->away = g_strdup(""); |
216 } else if (!g_strcasecmp(state, AGG_STATUS_NOT_AVAIL)) { | 219 } else if (!g_strcasecmp(state, AGG_STATUS_NOT_AVAIL)) { |
217 status = GG_STATUS_NOT_AVAIL; | 220 status = GG_STATUS_NOT_AVAIL; |
218 gc->away = ""; | 221 gc->away = g_strdup(""); |
219 } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) { | 222 } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) { |
220 if (msg) { | 223 if (msg) { |
221 status = GG_STATUS_BUSY; | 224 status = GG_STATUS_BUSY; |
222 gc->away = ""; | 225 gc->away = g_strdup(""); |
223 } else | 226 } else |
224 status = GG_STATUS_AVAIL; | 227 status = GG_STATUS_AVAIL; |
225 | 228 |
226 if (gd->own_status & GG_STATUS_FRIENDS_MASK) | 229 if (gd->own_status & GG_STATUS_FRIENDS_MASK) |
227 status |= GG_STATUS_FRIENDS_MASK; | 230 status |= GG_STATUS_FRIENDS_MASK; |