aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-11-21 09:32:54 +0100
committerMarius Halden <marius.h@lden.org>2016-11-21 09:32:54 +0100
commit434336755175aa390c64e34206b58b8954b3fffe (patch)
tree02d406c2e8ce3f3281b39c6577965685f4d795d6 /root_commands.c
parent08e1027c558a25b0b4f9410048c185e89c7b347a (diff)
parent5a8afc3f24a5308799d3960cab5726228345022d (diff)
Merge branch 'master' into patched-master
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 338fdf5f..b1ca8296 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -506,7 +506,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)";
@@ -518,7 +518,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++;
}
@@ -532,7 +539,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);
@@ -592,6 +599,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);
}