Changeset 5a8afc3 for protocols/nogaim.c


Ignore:
Timestamp:
2016-11-21T06:58:47Z (7 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
3f44e43, f8c9347
Parents:
11d4123
git-author:
dequis <dx@…> (21-11-16 06:40:54)
git-committer:
dequis <dx@…> (21-11-16 06:58:47)
Message:

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!)"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r11d4123 r5a8afc3  
    160160GList *protocols = NULL;
    161161GList *disabled_protocols = NULL;
    162 static struct prpl *unknown_prpl;
    163162
    164163void register_protocol(struct prpl *p)
     
    190189        GList *gl = g_list_find_custom(protocols, name, proto_name_cmp);
    191190        return gl ? gl->data: NULL;
    192 }
    193 
    194 struct prpl *make_unknown_protocol(const char *name)
    195 {
    196         struct prpl *ret = g_memdup(unknown_prpl, sizeof(struct prpl));
    197         ret->name = g_strdup(name);
    198         register_protocol(ret);
    199         return ret;
    200191}
    201192
     
    250241        extern void twitter_initmodule();
    251242        extern void purple_initmodule();
    252         extern void unknown_prpl_initmodule();
    253 
    254         unknown_prpl_initmodule(&unknown_prpl);
    255243
    256244#ifdef WITH_MSN
Note: See TracChangeset for help on using the changeset viewer.