Changeset c17d0af for protocols


Ignore:
Timestamp:
2018-07-05T07:03:35Z (6 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
19ba56e
Parents:
9e83b15
git-author:
dequis <dx@…> (05-07-18 07:00:57)
git-committer:
dequis <dx@…> (05-07-18 07:03:35)
Message:

purple: Add "bitlbee-set-account-password" signal

Replacement API for purple_account_set_password() to be called by prpls
that wish to store updated passwords or oauth tokens, since our password
storage doesn't get notified of calls to purple_account_set_password().

Added so that the hangouts plugin can stop using that awful hack for the
oauth refresh token

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r9e83b15 rc17d0af  
    17731773};
    17741774
     1775static void *prplcb_bitlbee_set_account_password(PurpleAccount *account, char *password)
     1776{
     1777        struct im_connection *ic = purple_ic_by_pa(account);
     1778
     1779        set_setstr(&ic->acc->set, "password", password ? password : "");
     1780
     1781        return GINT_TO_POINTER(TRUE);
     1782}
     1783
    17751784extern PurpleXferUiOps bee_xfer_uiops;
    17761785
     
    18611870        purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped",
    18621871                              &funcs, PURPLE_CALLBACK(prplcb_buddy_typing), NULL);
     1872
     1873        /* "bitlbee-set-account-password" signal:
     1874         * Replacement API for purple_account_set_password() to be called by
     1875         * prpls that wish to store updated passwords or oauth tokens, since
     1876         * our password storage doesn't get notified of calls to
     1877         * purple_account_set_password().
     1878         *
     1879         * When used with purple_signal_emit_return_1() returns:
     1880         *  - GINT_TO_POINTER(TRUE) if implemented by this version of bitlbee
     1881         *  - NULL otherwise.
     1882         *
     1883         * Originally made for the hangouts plugin.
     1884         */
     1885
     1886        purple_signal_register(purple_accounts_get_handle(), "bitlbee-set-account-password",
     1887                               purple_marshal_POINTER__POINTER_POINTER,
     1888                               purple_value_new(PURPLE_TYPE_BOOLEAN), 2,
     1889                               purple_value_new(PURPLE_TYPE_SUBTYPE, PURPLE_SUBTYPE_ACCOUNT),
     1890                               purple_value_new(PURPLE_TYPE_STRING));
     1891
     1892        purple_signal_connect(purple_accounts_get_handle(), "bitlbee-set-account-password",
     1893                              &funcs, PURPLE_CALLBACK(prplcb_bitlbee_set_account_password), NULL);
    18631894
    18641895        memset(&funcs, 0, sizeof(funcs));
Note: See TracChangeset for help on using the changeset viewer.