Changeset fecdd71


Ignore:
Timestamp:
2016-11-04T23:48:52Z (3 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
30093fa
Parents:
50988d1
Message:

purple: hack to pass server parameter to jabber's input request

Because our purple module is all about hacks, adding more can't hurt.

There's a string comparison for "Enter a Conference Server". It's
gettexted in the source but in practice it isn't affected by locale
(bitlbee disables localization).

Worst case, if this stops working, it will open an input request like it
did before this commit. It also does that in purple's jabber if you
don't provide a server parameter.

Location:
protocols/purple
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/bpurple.h

    r50988d1 rfecdd71  
    1313    GHashTable *input_requests;
    1414    guint next_request_id;
     15    char *chat_list_server;
    1516};
    1617
  • protocols/purple/purple.c

    r50988d1 rfecdd71  
    389389        purple_accounts_remove(pd->account);
    390390        imcb_chat_list_free(ic);
     391        g_free(pd->chat_list_server);
    391392        g_hash_table_destroy(pd->input_requests);
    392393        g_free(pd);
     
    782783                return;
    783784        }
     785
     786        g_free(pd->chat_list_server);
     787        pd->chat_list_server = (server && *server) ? g_strdup(server) : NULL;
    784788
    785789        list = purple_roomlist_get_list(pd->account->gc);
     
    12301234        struct im_connection *ic = purple_ic_by_pa(account);
    12311235        struct purple_data *pd = ic->proto_data;
    1232         struct request_input_data *ri = g_new0(struct request_input_data, 1);
    1233         guint id = pd->next_request_id++;
     1236        struct request_input_data *ri;
     1237        guint id;
     1238
     1239        /* hack so that jabber's chat list doesn't ask for conference server twice */
     1240        if (pd->chat_list_server && title && g_strcmp0(title, "Enter a Conference Server") == 0) {
     1241                ((ri_callback_t) ok_cb)(user_data, pd->chat_list_server);
     1242                g_free(pd->chat_list_server);
     1243                pd->chat_list_server = NULL;
     1244                return NULL;
     1245        }
     1246
     1247        id = pd->next_request_id++;
     1248        ri = g_new0(struct request_input_data, 1);
    12341249
    12351250        ri->id = id;
     
    13921407{
    13931408        struct im_connection *ic;
     1409        struct purple_data *pd;
    13941410        struct purple_roomlist_data *rld = list->ui_data;
    13951411
     
    14001416        ic = purple_ic_by_pa(list->account);
    14011417        imcb_chat_list_free(ic);
     1418
     1419        pd = ic->proto_data;
     1420        g_free(pd->chat_list_server);
     1421        pd->chat_list_server = NULL;
    14021422
    14031423        ic->chatlist = g_slist_reverse(rld->chats);
Note: See TracChangeset for help on using the changeset viewer.