diff options
author | dequis <dx@dxzone.com.ar> | 2016-11-19 04:32:48 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2016-11-19 04:32:48 -0300 |
commit | b4f496e7e9a22768f76c13b96deb1997bab55414 (patch) | |
tree | de88e67bf23d8303ed2e7987dd806822f53ef36a /protocols/nogaim.h | |
parent | 9f03c472fef309878ff2f3bc720d51e6d03077f1 (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 'protocols/nogaim.h')
-rw-r--r-- | protocols/nogaim.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/protocols/nogaim.h b/protocols/nogaim.h index b5a46524..3aa89c3b 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -158,6 +158,9 @@ typedef enum { /* The protocol is not suitable for OTR, see OPT_NOOTR */ PRPL_OPT_NOOTR = 1 << 12, + + /* This prpl is a placeholder for a missing protocol */ + PRPL_OPT_UNKNOWN_PROTOCOL = 1 << 13, } prpl_options_t; struct prpl { @@ -320,6 +323,8 @@ G_MODULE_EXPORT GList *get_protocols_disabled(); G_MODULE_EXPORT GSList *get_connections(); G_MODULE_EXPORT struct prpl *find_protocol(const char *name); G_MODULE_EXPORT gboolean is_protocol_disabled(const char *name); +G_MODULE_EXPORT struct prpl *make_unknown_protocol(const char *name); +G_MODULE_EXPORT char *explain_unknown_protocol(const char *name); /* When registering a new protocol, you should allocate space for a new prpl * struct, initialize it (set the function pointers to point to your * functions), finally call this function. */ |