Ignore:
Timestamp:
2016-11-20T08:40:36Z (7 years ago)
Author:
dequis <dx@…>
Children:
3f44e43
Parents:
ba52ac5 (diff), 9f03c47 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge master up to commit '9f03c47' into parson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    rba52ac5 r537d9b9  
    8282        s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK;
    8383
     84        set_add(&acc->set, "oauth", "false", set_eval_oauth, acc);
     85
    8486        if (strcmp(acc->prpl->name, "hipchat") == 0) {
    8587                set_setstr(&acc->set, "server", "chat.hipchat.com");
    8688        } else {
    87                 set_add(&acc->set, "oauth", "false", set_eval_oauth, acc);
    88 
    8989                /* this reuses set_eval_oauth, which clears the password */
    9090                set_add(&acc->set, "anonymous", "false", set_eval_oauth, acc);
     
    321321        struct jabber_data *jd = ic->proto_data;
    322322
     323        imcb_chat_list_free(ic);
     324
    323325        while (jd->filetransfers) {
    324326                imcb_file_canceled(ic, (( struct jabber_transfer *) jd->filetransfers->data)->ft, "Logging out");
     
    397399        if (g_strcasecmp(who, JABBER_OAUTH_HANDLE) == 0 &&
    398400            !(jd->flags & OPT_LOGGED_IN) && jd->fd == -1) {
    399                 if (sasl_oauth2_get_refresh_token(ic, message)) {
     401
     402                if (jd->flags & JFLAG_HIPCHAT) {
     403                        sasl_oauth2_got_token(ic, message, NULL, NULL);
     404                        return 1;
     405                } else if (sasl_oauth2_get_refresh_token(ic, message)) {
    400406                        return 1;
    401407                } else {
     
    577583        } else {
    578584                /* jabber_chat_join without the underscore is the conference.c one */
    579                 return jabber_chat_join(ic, room, final_nick, set_getstr(sets, "password"));
     585                return jabber_chat_join(ic, room, final_nick, set_getstr(sets, "password"),
     586                                        set_getbool(sets, "always_use_nicks"));
    580587        }
    581588
     
    586593{
    587594        return jabber_chat_with(ic, who);
     595}
     596
     597static void jabber_chat_list_(struct im_connection *ic, const char *server)
     598{
     599        struct jabber_data *jd = ic->proto_data;
     600
     601        if (server && *server) {
     602                jabber_iq_disco_muc(ic, server);
     603        } else if (jd->muc_host && *jd->muc_host) {
     604                jabber_iq_disco_muc(ic, jd->muc_host);
     605        } else {
     606                /* throw an error here, don't query conference.[server] directly.
     607                 * for things like jabber.org it gets you 18000 results of garbage */
     608                imcb_error(ic, "Please specify a server name such as `conference.%s'", jd->server);
     609        }
    588610}
    589611
     
    686708void jabber_chat_add_settings(account_t *acc, set_t **head)
    687709{
     710        set_add(head, "always_use_nicks", "false", set_eval_bool, NULL);
     711
    688712        /* Meh. Stupid room passwords. Not trying to obfuscate/hide
    689713           them from the user for now. */
     
    693717void jabber_chat_free_settings(account_t *acc, set_t **head)
    694718{
     719        set_del(head, "always_use_nicks");
     720
    695721        set_del(head, "password");
    696722}
     
    759785        ret->chat_join = jabber_chat_join_;
    760786        ret->chat_with = jabber_chat_with_;
     787        ret->chat_list = jabber_chat_list_;
    761788        ret->chat_add_settings = jabber_chat_add_settings;
    762789        ret->chat_free_settings = jabber_chat_free_settings;
Note: See TracChangeset for help on using the changeset viewer.