Changeset 93e0901


Ignore:
Timestamp:
2015-05-24T18:51:57Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
8c3637b
Parents:
2446e4c
Message:

ACC_FLAG_LOCAL -> ACC_FLAG_LOCAL_CONTACTS.

Also, handle the flag more properly. The config loader was not the right
place to do this in.

Next up: Add a way for a protocol module to fetch the contact list
pre-login.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocols/account.c

    r2446e4c r93e0901  
    2727#include "bitlbee.h"
    2828#include "account.h"
    29 
    30 static const char* account_protocols_local[] = {
    31         "gg", "whatsapp", NULL
    32 };
    3329
    3430static char *set_eval_nick_source(set_t *set, char *value);
     
    463459        return a->auto_reconnect_delay;
    464460}
    465 
    466 int protocol_account_islocal(const char* protocol)
    467 {
    468         const char** p = account_protocols_local;
    469 
    470         do {
    471                 if (strcmp(*p, protocol) == 0) {
    472                         return 1;
    473                 }
    474         } while (*(++p));
    475         return 0;
    476 }
  • protocols/account.h

    r2446e4c r93e0901  
    5858int account_reconnect_delay(account_t *a);
    5959
    60 int protocol_account_islocal(const char* protocol);
    61 
    6260typedef enum {
    6361        ACC_SET_OFFLINE_ONLY = 0x02,    /* Allow changes only if the acct is offline. */
     
    6967        ACC_FLAG_STATUS_MESSAGE = 0x02, /* Supports status messages (without being away). */
    7068        ACC_FLAG_HANDLE_DOMAINS = 0x04, /* Contact handles need a domain portion. */
    71         ACC_FLAG_LOCAL = 0x08,          /* Contact list is local. */
     69        ACC_FLAG_LOCAL_CONTACTS = 0x08, /* Contact list is local. */
    7270} account_flag_t;
    7371
  • protocols/nogaim.c

    r2446e4c r93e0901  
    312312        }
    313313
    314         if (ic->acc->flags & ACC_FLAG_LOCAL) {
     314        if (ic->acc->flags & ACC_FLAG_LOCAL_CONTACTS) {
    315315                GHashTableIter nicks;
    316316                gpointer k, v;
  • protocols/purple/purple.c

    r2446e4c r93e0901  
    261261        }
    262262        purple_accounts_remove(pa);
     263       
     264        /* Last, some protocols want their contact lists locally. */
     265        if (strcmp(acc->prpl->name, "whatsapp") == 0 || strcmp(acc->prpl->name, "gg") == 0) {
     266                acc->flags |= ACC_FLAG_LOCAL_CONTACTS;
     267        }
    263268}
    264269
  • storage_xml.c

    r2446e4c r93e0901  
    8989        char *pass_b64 = NULL;
    9090        unsigned char *pass_cr = NULL;
    91         int pass_len, local = 0;
     91        int pass_len;
    9292        struct prpl *prpl = NULL;
    9393        account_t *acc;
     
    107107                        return XT_ABORT;
    108108                }
    109                 local = protocol_account_islocal(protocol);
    110109        }
    111110
     
    123122                if (tag) {
    124123                        set_setstr(&acc->set, "tag", tag);
    125                 }
    126                 if (local) {
    127                         acc->flags |= ACC_FLAG_LOCAL;
    128124                }
    129125        } else {
Note: See TracChangeset for help on using the changeset viewer.