Mercurial > pidgin.yaz
diff 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 |
line wrap: on
line diff
--- a/src/gtkconn.c Fri Jul 18 14:30:22 2003 +0000 +++ b/src/gtkconn.c Fri Jul 18 14:34:08 2003 +0000 @@ -22,6 +22,7 @@ #include "account.h" #include "debug.h" +#include "prefs.h" #include "util.h" #include "gtkblist.h" @@ -282,7 +283,7 @@ } -void away_on_login(char *mesg) +void away_on_login(const char *mesg) { GSList *awy = away_messages; struct away_message *a, *message = NULL; @@ -294,22 +295,20 @@ return; } - if (mesg == NULL) { - /* Use default message */ - do_away_message(NULL, default_away); - } else { - /* Use argument */ - while (awy) { - a = (struct away_message *)awy->data; - if (strcmp(a->name, mesg) == 0) { - message = a; - break; - } - awy = awy->next; + if (mesg == NULL) + mesg = gaim_prefs_get_string("/core/away/default_message"); + while (awy) { + a = (struct away_message *)awy->data; + if (strcmp(a->name, mesg) == 0) { + message = a; + break; } - if (message == NULL) - message = default_away; - do_away_message(NULL, message); + awy = awy->next; } - return; + if (message == NULL) { + if(!away_messages) + return; + message = away_messages->data; + } + do_away_message(NULL, message); }