aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/root_commands.c b/root_commands.c
index 1bbd1722..e0c0b7f8 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -497,7 +497,7 @@ static void cmd_account(irc_t *irc, char **cmd)
}
for (a = irc->b->accounts; a; a = a->next) {
- char *con;
+ char *con = NULL, *protocol = NULL;
if (a->ic && (a->ic->flags & OPT_LOGGED_IN)) {
con = " (connected)";
@@ -509,7 +509,14 @@ static void cmd_account(irc_t *irc, char **cmd)
con = "";
}
- irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, a->prpl->name, a->user, con);
+ if (a->prpl == &protocol_missing) {
+ protocol = g_strdup_printf("%s (missing!)", set_getstr(&a->set, "_protocol_name"));
+ } else {
+ protocol = g_strdup(a->prpl->name);
+ }
+
+ irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, protocol, a->user, con);
+ g_free(protocol);
i++;
}
@@ -523,7 +530,7 @@ static void cmd_account(irc_t *irc, char **cmd)
irc_rootmsg(irc, "Trying to get all accounts connected...");
for (a = irc->b->accounts; a; a = a->next) {
- if (!a->ic && a->auto_connect) {
+ if (!a->ic && a->auto_connect && a->prpl != &protocol_missing) {
if (strcmp(a->pass, PASSWORD_PENDING) == 0) {
irc_rootmsg(irc, "Enter password for account %s "
"first (use /OPER)", a->tag);
@@ -583,6 +590,12 @@ static void cmd_account(irc_t *irc, char **cmd)
} else if (strcmp(a->pass, PASSWORD_PENDING) == 0) {
irc_rootmsg(irc, "Enter password for account %s "
"first (use /OPER)", a->tag);
+ } else if (a->prpl == &protocol_missing) {
+ char *proto = set_getstr(&a->set, "_protocol_name");
+ char *msg = explain_unknown_protocol(proto);
+ irc_rootmsg(irc, "Unknown protocol `%s'", proto);
+ irc_rootmsg(irc, msg);
+ g_free(msg);
} else {
account_on(irc->b, a);
}