Changeset b4f496e for root_commands.c


Ignore:
Timestamp:
2016-11-19T07:32:48Z (7 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
a7baf40
Parents:
9f03c47
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r9f03c47 rb4f496e  
    439439
    440440                if (prpl == NULL) {
    441                         if (is_protocol_disabled(cmd[2])) {
    442                                 irc_rootmsg(irc, "Protocol disabled in global config");
    443                         } else {
    444                                 irc_rootmsg(irc, "Unknown protocol");
    445                         }
     441                        char *msg = explain_unknown_protocol(cmd[2]);
     442                        irc_rootmsg(irc, "Unknown protocol");
     443                        irc_rootmsg(irc, msg);
     444                        g_free(msg);
    446445                        return;
    447446                }
Note: See TracChangeset for help on using the changeset viewer.