Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    rb441614 r5ebff60  
    460460
    461461                for (a = irc->b->accounts; a; a = a->next) {
    462                         char *con = NULL, *protocol = NULL;
     462                        char *con;
    463463
    464464                        if (a->ic && (a->ic->flags & OPT_LOGGED_IN)) {
     
    471471                                con = "";
    472472                        }
    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);
     473
     474                        irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, a->prpl->name, a->user, con);
    481475
    482476                        i++;
     
    492486
    493487                        for (a = irc->b->accounts; a; a = a->next) {
    494                                 if (!a->ic && a->auto_connect && a->prpl != &protocol_missing) {
     488                                if (!a->ic && a->auto_connect) {
    495489                                        if (strcmp(a->pass, PASSWORD_PENDING) == 0) {
    496490                                                irc_rootmsg(irc, "Enter password for account %s "
     
    549543                        irc_rootmsg(irc, "Enter password for account %s "
    550544                                    "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"));
    554545                } else {
    555546                        account_on(irc->b, a);
     
    656647                irc_rootmsg(irc, "That account is not on-line");
    657648                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;
     649        }
     650
     651        if (cmd[3]) {
     652                if (!nick_ok(irc, cmd[3])) {
     653                        irc_rootmsg(irc, "The requested nick `%s' is invalid", cmd[3]);
     654                        return;
     655                } else if (irc_user_by_name(irc, cmd[3])) {
     656                        irc_rootmsg(irc, "The requested nick `%s' already exists", cmd[3]);
     657                        return;
     658                } else {
     659                        nick_set_raw(a, cmd[2], cmd[3]);
     660                }
    661661        }
    662662
     
    674674        }
    675675
    676         if (cmd[3]) {
    677                 if (!nick_ok(irc, cmd[3])) {
    678                         irc_rootmsg(irc, "The requested nick `%s' is invalid", cmd[3]);
    679                         return;
    680                 } else if (irc_user_by_name(irc, cmd[3])) {
    681                         irc_rootmsg(irc, "The requested nick `%s' already exists", cmd[3]);
    682                         return;
    683                 } else {
    684                         nick_set_raw(a, cmd[2], cmd[3]);
    685                 }
    686         }
    687 
    688676        if (add_on_server) {
    689677                irc_channel_t *ic;
     
    729717        s = g_strdup(bu->handle);
    730718
    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 
     719        bu->ic->acc->prpl->remove_buddy(bu->ic, bu->handle, NULL);
    738720        nick_del(bu);
    739721        if (g_slist_find(irc->users, iu)) {
Note: See TracChangeset for help on using the changeset viewer.