Mercurial > pidgin.yaz
diff src/protocols/irc/irc.c @ 10646:6a618db0a404
[gaim-migrate @ 12162]
Made IRC, Jabber, MSN, and ICQ not crash on login. Note that these don't
necessarily work the way they should yet, they just don't crash.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 01 Mar 2005 21:15:58 +0000 |
parents | 235e72d7bb0a |
children | 811f12c8a5e4 |
line wrap: on
line diff
--- a/src/protocols/irc/irc.c Mon Feb 28 18:18:22 2005 +0000 +++ b/src/protocols/irc/irc.c Tue Mar 01 21:15:58 2005 +0000 @@ -434,19 +434,24 @@ static void irc_set_status(GaimAccount *account, GaimStatus *status) { GaimConnection *gc = gaim_account_get_connection(account); - struct irc_conn *irc = gc->proto_data; + struct irc_conn *irc; const char *args[1]; const char *status_id = gaim_status_get_id(status); + if (gc) + irc = gc->proto_data; + if (!gaim_status_is_active(status)) return; args[0] = NULL; - if (!strcmp(status_id, "away")) + if (strcmp(status_id, "offline") && !gc) { + gaim_account_connect(account, status); + } else if (!strcmp(status_id, "away")) { args[0] = gaim_status_get_attr_string(status, "message"); - - irc_cmd_away(irc, "away", NULL, args); + irc_cmd_away(irc, "away", NULL, args); + } } static void irc_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group)