Mercurial > pidgin.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
10645:6480697e907b | 10646:6a618db0a404 |
---|---|
432 } | 432 } |
433 | 433 |
434 static void irc_set_status(GaimAccount *account, GaimStatus *status) | 434 static void irc_set_status(GaimAccount *account, GaimStatus *status) |
435 { | 435 { |
436 GaimConnection *gc = gaim_account_get_connection(account); | 436 GaimConnection *gc = gaim_account_get_connection(account); |
437 struct irc_conn *irc = gc->proto_data; | 437 struct irc_conn *irc; |
438 const char *args[1]; | 438 const char *args[1]; |
439 const char *status_id = gaim_status_get_id(status); | 439 const char *status_id = gaim_status_get_id(status); |
440 | 440 |
441 if (gc) | |
442 irc = gc->proto_data; | |
443 | |
441 if (!gaim_status_is_active(status)) | 444 if (!gaim_status_is_active(status)) |
442 return; | 445 return; |
443 | 446 |
444 args[0] = NULL; | 447 args[0] = NULL; |
445 | 448 |
446 if (!strcmp(status_id, "away")) | 449 if (strcmp(status_id, "offline") && !gc) { |
450 gaim_account_connect(account, status); | |
451 } else if (!strcmp(status_id, "away")) { | |
447 args[0] = gaim_status_get_attr_string(status, "message"); | 452 args[0] = gaim_status_get_attr_string(status, "message"); |
448 | 453 irc_cmd_away(irc, "away", NULL, args); |
449 irc_cmd_away(irc, "away", NULL, args); | 454 } |
450 } | 455 } |
451 | 456 |
452 static void irc_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) | 457 static void irc_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
453 { | 458 { |
454 struct irc_conn *irc = (struct irc_conn *)gc->proto_data; | 459 struct irc_conn *irc = (struct irc_conn *)gc->proto_data; |