Ignore:
Timestamp:
2016-12-27T00:29:30Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
c11b68a
Parents:
1882b70
Message:

purple: hack to keep the purple-line auth token in the config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r1882b70 rfaa7abb6  
    124124                "prpl-eionrobb-funyahoo-plusplus",
    125125                "prpl-icq",
     126                "prpl-line",
    126127                NULL,
    127128        };
     
    304305        }
    305306
     307        if (g_strcmp0(prpl->info->id, "prpl-line") == 0) {
     308                s = set_add(&acc->set, "line-auth-token", NULL, NULL, acc);
     309                s->flags |= SET_HIDDEN;
     310        }
     311
    306312        /* Go through all away states to figure out if away/status messages
    307313           are possible. */
     
    361367        if (pi->options & OPT_PROTO_MAIL_CHECK) {
    362368                purple_account_set_check_mail(pa, set_getbool(&acc->set, "mail_notifications"));
     369        }
     370
     371        if (g_strcmp0(prpl->info->id, "prpl-line") == 0) {
     372                const char *name = "line-auth-token";
     373                purple_account_set_string(pa, name, set_getstr(&acc->set, name));
    363374        }
    364375}
     
    957968{
    958969        struct im_connection *ic = purple_ic_by_gc(gc);
    959         const char *dn;
     970        struct purple_data *pd = ic->proto_data;
     971        const char *dn, *token;
    960972        set_t *s;
    961973
     
    970982        // user list needs to be requested for Gadu-Gadu
    971983        purple_gg_buddylist_import(gc);
     984
     985        /* more awful hacks, because clearly we didn't have enough of those */
     986        if ((s = set_find(&ic->acc->set, "line-auth-token")) &&
     987            (token = purple_account_get_string(pd->account, "line-auth-token", NULL))) {
     988                g_free(s->value);
     989                s->value = g_strdup(token);
     990        }
    972991
    973992        ic->flags |= OPT_DOES_HTML;
Note: See TracChangeset for help on using the changeset viewer.