From 5a8afc3f24a5308799d3960cab5726228345022d Mon Sep 17 00:00:00 2001 From: dequis Date: Mon, 21 Nov 2016 03:40:54 -0300 Subject: Manual merge with wilmer's approach to handling missing protocols Turns out he already implemented pretty much the same thing in the parson branch... last year. The differences between the two approaches are subtle (there aren't too many ways to do this, some lines are the exact same thing) but I decided I like his version better, so this mostly reverts a handful of my changes while keeping others. The main advantage of his approach is that no fake protocols are registered, no actual prpl functions are called, and the missing prpl is a singleton constant. New things compared to the implementation in the other branch: - The explain_unknown_protocol() function. - Fixed named chatrooms throwing a warning and losing the "account" setting when saving. See changes in irc_im.c - Fixed the "server" setting dropping when saving. See account.c Differences with my previous implementation: - Accounts with missing protocols don't autoconnect - 'account list' marks them as "(missing!)" --- protocols/nogaim.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'protocols/nogaim.c') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 8a22654e..2f6b3783 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -159,7 +159,6 @@ GList *get_plugins() GList *protocols = NULL; GList *disabled_protocols = NULL; -static struct prpl *unknown_prpl; void register_protocol(struct prpl *p) { @@ -191,14 +190,6 @@ struct prpl *find_protocol(const char *name) return gl ? gl->data: NULL; } -struct prpl *make_unknown_protocol(const char *name) -{ - struct prpl *ret = g_memdup(unknown_prpl, sizeof(struct prpl)); - ret->name = g_strdup(name); - register_protocol(ret); - return ret; -} - gboolean is_protocol_disabled(const char *name) { return g_list_find_custom(disabled_protocols, name, proto_name_cmp) != NULL; @@ -249,9 +240,6 @@ void nogaim_init() extern void jabber_initmodule(); extern void twitter_initmodule(); extern void purple_initmodule(); - extern void unknown_prpl_initmodule(); - - unknown_prpl_initmodule(&unknown_prpl); #ifdef WITH_MSN msn_initmodule(); -- cgit v1.2.3