Changes in root_commands.c [ad9ac5d:b441614]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
rad9ac5d rb441614 163 163 irc_umode_set(irc, "+R", 1); 164 164 165 if (irc->caps & CAP_SASL) {166 irc_user_t *iu = irc->user;167 irc_send_num(irc, 900, "%s!%s@%s %s :You are now logged in as %s",168 iu->nick, iu->user, iu->host, iu->nick, iu->nick);169 }170 171 165 bitlbee_whatsnew(irc); 172 166 … … 244 238 irc->status |= USTATUS_IDENTIFIED; 245 239 irc_umode_set(irc, "+R", 1); 246 247 if (irc->caps & CAP_SASL) {248 irc_user_t *iu = irc->user;249 irc_send_num(irc, 900, "%s!%s@%s %s :You are now logged in as %s",250 iu->nick, iu->user, iu->host, iu->nick, iu->nick);251 }252 240 253 241 /* Set this var now, or anyone who logs in to his/her … … 425 413 426 414 if (prpl == NULL) { 427 if (is_protocol_disabled(cmd[2])) { 428 irc_rootmsg(irc, "Protocol disabled in global config"); 429 } else { 430 irc_rootmsg(irc, "Unknown protocol"); 431 } 415 irc_rootmsg(irc, "Unknown protocol"); 432 416 return; 433 417 } … … 476 460 477 461 for (a = irc->b->accounts; a; a = a->next) { 478 char *con ;462 char *con = NULL, *protocol = NULL; 479 463 480 464 if (a->ic && (a->ic->flags & OPT_LOGGED_IN)) { … … 487 471 con = ""; 488 472 } 489 490 irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, a->prpl->name, a->user, con); 473 if (a->prpl == &protocol_missing) { 474 protocol = g_strdup_printf("%s (missing!)", set_getstr(&a->set, "_protocol_name")); 475 } else { 476 protocol = g_strdup(a->prpl->name); 477 } 478 479 irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, protocol, a->user, con); 480 g_free(protocol); 491 481 492 482 i++; … … 502 492 503 493 for (a = irc->b->accounts; a; a = a->next) { 504 if (!a->ic && a->auto_connect ) {494 if (!a->ic && a->auto_connect && a->prpl != &protocol_missing) { 505 495 if (strcmp(a->pass, PASSWORD_PENDING) == 0) { 506 496 irc_rootmsg(irc, "Enter password for account %s " … … 559 549 irc_rootmsg(irc, "Enter password for account %s " 560 550 "first (use /OPER)", a->tag); 551 } else if (a->prpl == &protocol_missing) { 552 irc_rootmsg(irc, "Protocol `%s' not recognised (plugin may be missing or not running?)", 553 set_getstr(&a->set, "_protocol_name")); 561 554 } else { 562 555 account_on(irc->b, a); … … 663 656 irc_rootmsg(irc, "That account is not on-line"); 664 657 return; 658 } else if (add_on_server && !a->prpl->add_buddy) { 659 irc_rootmsg(irc, "IM protocol does not support contact list modification"); 660 return; 661 } 662 663 if ((a->flags & ACC_FLAG_HANDLE_DOMAINS) && cmd[2][0] != '_' && 664 (!(s = strchr(cmd[2], '@')) || s[1] == '\0')) { 665 /* If there's no @ or it's the last char, append the user's 666 domain name now. Exclude handles starting with a _ so 667 adding _xmlconsole will keep working. */ 668 if (s) { 669 *s = '\0'; 670 } 671 if ((s = strchr(a->user, '@'))) { 672 cmd[2] = handle = g_strconcat(cmd[2], s, NULL); 673 } 665 674 } 666 675 … … 677 686 } 678 687 679 if ((a->flags & ACC_FLAG_HANDLE_DOMAINS) && cmd[2][0] != '_' &&680 (!(s = strchr(cmd[2], '@')) || s[1] == '\0')) {681 /* If there's no @ or it's the last char, append the user's682 domain name now. Exclude handles starting with a _ so683 adding _xmlconsole will keep working. */684 if (s) {685 *s = '\0';686 }687 if ((s = strchr(a->user, '@'))) {688 cmd[2] = handle = g_strconcat(cmd[2], s, NULL);689 }690 }691 692 688 if (add_on_server) { 693 689 irc_channel_t *ic; … … 733 729 s = g_strdup(bu->handle); 734 730 735 bu->ic->acc->prpl->remove_buddy(bu->ic, bu->handle, NULL); 731 if (bu->ic->acc->prpl->remove_buddy) { 732 bu->ic->acc->prpl->remove_buddy(bu->ic, bu->handle, NULL); 733 } else { 734 irc_rootmsg(irc, "IM protocol does not support contact list modification, " 735 "removal will likely not be permanent"); 736 } 737 736 738 nick_del(bu); 737 739 if (g_slist_find(irc->users, iu)) {
Note: See TracChangeset
for help on using the changeset viewer.