aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2016-11-19 04:32:48 -0300
committerdequis <dx@dxzone.com.ar>2016-11-19 04:32:48 -0300
commitb4f496e7e9a22768f76c13b96deb1997bab55414 (patch)
treede88e67bf23d8303ed2e7987dd806822f53ef36a /root_commands.c
parent9f03c472fef309878ff2f3bc720d51e6d03077f1 (diff)
Improve handling of unknown protocols / missing plugins
Instead of failing to load the config, a fake prpl is created to load the account, keep its settings, and refuse to log in with a helpful error message. Also added a new explain_unknown_protocol() function which returns text which attempts to explain why a protocol is missing, handling several typical cases, including the future removal of several dead libpurple plugins. That message is shown when logging in to a loaded account with a missing protocol and when adding a new one with 'account add', with the difference that the latter doesn't leave a placeholder fake account.
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/root_commands.c b/root_commands.c
index 732949d8..1bbd1722 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -438,11 +438,10 @@ static void cmd_account(irc_t *irc, char **cmd)
prpl = find_protocol(cmd[2]);
if (prpl == NULL) {
- if (is_protocol_disabled(cmd[2])) {
- irc_rootmsg(irc, "Protocol disabled in global config");
- } else {
- irc_rootmsg(irc, "Unknown protocol");
- }
+ char *msg = explain_unknown_protocol(cmd[2]);
+ irc_rootmsg(irc, "Unknown protocol");
+ irc_rootmsg(irc, msg);
+ g_free(msg);
return;
}