Mercurial > pidgin.yaz
comparison src/gtkconn.c @ 6216:dc42b27101c0
[gaim-migrate @ 6702]
fix the saving and importing of the default away message
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 18 Jul 2003 14:34:08 +0000 |
parents | 3c70f8be8558 |
children | 8f94cce8faa5 |
comparison
equal
deleted
inserted
replaced
6215:643c7d3a18c2 | 6216:dc42b27101c0 |
---|---|
20 */ | 20 */ |
21 #include "internal.h" | 21 #include "internal.h" |
22 | 22 |
23 #include "account.h" | 23 #include "account.h" |
24 #include "debug.h" | 24 #include "debug.h" |
25 #include "prefs.h" | |
25 #include "util.h" | 26 #include "util.h" |
26 | 27 |
27 #include "gtkblist.h" | 28 #include "gtkblist.h" |
28 #include "gtkutils.h" | 29 #include "gtkutils.h" |
29 | 30 |
280 { | 281 { |
281 return &conn_ui_ops; | 282 return &conn_ui_ops; |
282 } | 283 } |
283 | 284 |
284 | 285 |
285 void away_on_login(char *mesg) | 286 void away_on_login(const char *mesg) |
286 { | 287 { |
287 GSList *awy = away_messages; | 288 GSList *awy = away_messages; |
288 struct away_message *a, *message = NULL; | 289 struct away_message *a, *message = NULL; |
289 struct gaim_gtk_buddy_list *gtkblist; | 290 struct gaim_gtk_buddy_list *gtkblist; |
290 | 291 |
292 | 293 |
293 if (!gtkblist->window) { | 294 if (!gtkblist->window) { |
294 return; | 295 return; |
295 } | 296 } |
296 | 297 |
297 if (mesg == NULL) { | 298 if (mesg == NULL) |
298 /* Use default message */ | 299 mesg = gaim_prefs_get_string("/core/away/default_message"); |
299 do_away_message(NULL, default_away); | 300 while (awy) { |
300 } else { | 301 a = (struct away_message *)awy->data; |
301 /* Use argument */ | 302 if (strcmp(a->name, mesg) == 0) { |
302 while (awy) { | 303 message = a; |
303 a = (struct away_message *)awy->data; | 304 break; |
304 if (strcmp(a->name, mesg) == 0) { | |
305 message = a; | |
306 break; | |
307 } | |
308 awy = awy->next; | |
309 } | 305 } |
310 if (message == NULL) | 306 awy = awy->next; |
311 message = default_away; | 307 } |
312 do_away_message(NULL, message); | 308 if (message == NULL) { |
313 } | 309 if(!away_messages) |
314 return; | 310 return; |
315 } | 311 message = away_messages->data; |
312 } | |
313 do_away_message(NULL, message); | |
314 } |