Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r5ebff60 rd628339  
    460460
    461461                for (a = irc->b->accounts; a; a = a->next) {
    462                         char *con;
     462                        char *con = NULL, *protocol = NULL;
    463463
    464464                        if (a->ic && (a->ic->flags & OPT_LOGGED_IN)) {
     
    471471                                con = "";
    472472                        }
    473 
    474                         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);
    475481
    476482                        i++;
     
    486492
    487493                        for (a = irc->b->accounts; a; a = a->next) {
    488                                 if (!a->ic && a->auto_connect) {
     494                                if (!a->ic && a->auto_connect && a->prpl != &protocol_missing) {
    489495                                        if (strcmp(a->pass, PASSWORD_PENDING) == 0) {
    490496                                                irc_rootmsg(irc, "Enter password for account %s "
     
    543549                        irc_rootmsg(irc, "Enter password for account %s "
    544550                                    "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"));
    545554                } else {
    546555                        account_on(irc->b, a);
     
    647656                irc_rootmsg(irc, "That account is not on-line");
    648657                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;
    649661        }
    650662
     
    717729        s = g_strdup(bu->handle);
    718730
    719         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
    720738        nick_del(bu);
    721739        if (g_slist_find(irc->users, iu)) {
Note: See TracChangeset for help on using the changeset viewer.