From ad9ac5dccf8d27700850c02946ad3242a45d6fa9 Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 23 Nov 2015 18:20:34 -0300 Subject: Show a nicer message when a protocol is disabled in account add This adds the disabled protocols' prpl structs to a different linked list, only used for this lookup. They were previously marked as leaking by valgrind, so, whatever. I can't free them, since some protocols memdup() it after attempting to register. I think disabling the protocols from bitlbee.conf is just stupid and provides no real benefits, but someone will complain if i get rid of it. So this just improves the error message to make it less confusing when someone accidentally uncomments that crap. --- root_commands.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index b5d0aef1..e6ed1602 100644 --- a/root_commands.c +++ b/root_commands.c @@ -424,7 +424,11 @@ static void cmd_account(irc_t *irc, char **cmd) prpl = find_protocol(cmd[2]); if (prpl == NULL) { - irc_rootmsg(irc, "Unknown protocol"); + if (is_protocol_disabled(cmd[2])) { + irc_rootmsg(irc, "Protocol disabled in global config"); + } else { + irc_rootmsg(irc, "Unknown protocol"); + } return; } -- cgit v1.2.3