Ignore:
Timestamp:
2015-11-21T00:01:50Z (5 years ago)
Author:
dequis <dx@…>
Parents:
e4f08bf (diff), 8fdeaa5 (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 branch 'master' into feat/hip-cat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    re4f08bf r29ff5c2  
    8585                set_setstr(&acc->set, "server", "chat.hipchat.com");
    8686        } else {
    87                 s = set_add(&acc->set, "oauth", "false", set_eval_oauth, acc);
     87                set_add(&acc->set, "oauth", "false", set_eval_oauth, acc);
     88
     89                /* this reuses set_eval_oauth, which clears the password */
     90                set_add(&acc->set, "anonymous", "false", set_eval_oauth, acc);
    8891        }
    8992
     
    194197        } else {
    195198                jabber_connect(ic);
     199        }
     200}
     201
     202static void jabber_xmlconsole_enable(struct im_connection *ic)
     203{
     204        struct jabber_data *jd = ic->proto_data;
     205        const char *handle = JABBER_XMLCONSOLE_HANDLE;
     206        bee_user_t *bu;
     207       
     208        jd->flags |= JFLAG_XMLCONSOLE;
     209
     210        if (!(bu = bee_user_by_handle(ic->bee, ic, handle))) {
     211                bu = bee_user_new(ic->bee, ic, handle, 0);
     212                bu->flags |= BEE_USER_NOOTR;
    196213        }
    197214}
     
    263280
    264281        if (set_getbool(&acc->set, "xmlconsole")) {
    265                 jd->flags |= JFLAG_XMLCONSOLE;
    266                 /* Shouldn't really do this at this stage already, maybe. But
    267                    I think this shouldn't break anything. */
    268                 imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL);
     282                jabber_xmlconsole_enable(ic);
    269283        }
    270284
     
    331345        }
    332346        if (jd->fd >= 0) {
    333                 closesocket(jd->fd);
     347                proxy_disconnect(jd->fd);
    334348        }
    335349
     
    342356        }
    343357
    344         jabber_buddy_remove_all(ic);
     358        if (jd->buddies) {
     359                jabber_buddy_remove_all(ic);
     360        }
    345361
    346362        xt_free(jd->xt);
     
    469485static void jabber_add_buddy(struct im_connection *ic, char *who, char *group)
    470486{
    471         struct jabber_data *jd = ic->proto_data;
    472 
    473487        if (g_strcasecmp(who, JABBER_XMLCONSOLE_HANDLE) == 0) {
    474                 jd->flags |= JFLAG_XMLCONSOLE;
    475                 imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL);
     488                jabber_xmlconsole_enable(ic);
    476489                return;
    477490        }
     
    587600{
    588601        struct jabber_data *jd = ic->proto_data;
    589         struct jabber_buddy *bud;
     602        struct jabber_buddy *bud, *bare;
    590603
    591604        /* Enable typing notification related code from now. */
    592605        jd->flags |= JFLAG_WANT_TYPING;
    593606
    594         if ((bud = jabber_buddy_by_jid(ic, who, 0)) == NULL) {
     607        if ((bud = jabber_buddy_by_jid(ic, who, 0)) == NULL ||
     608            (bare = jabber_buddy_by_jid(ic, who, GET_BUDDY_BARE)) == NULL) {
    595609                /* Sending typing notifications to unknown buddies is
    596610                   unsupported for now. Shouldn't be a problem, I think. */
     
    598612        }
    599613
    600         if (bud->flags & JBFLAG_DOES_XEP85) {
     614
     615        if (bud->flags & JBFLAG_DOES_XEP85 || bare->flags & JBFLAG_DOES_XEP85) {
    601616                /* We're only allowed to send this stuff if we know the other
    602                    side supports it. */
     617                   side supports it. If the bare JID has the flag, all other
     618                   resources get it, too (That is the case in gtalk) */
    603619
    604620                struct xt_node *node;
Note: See TracChangeset for help on using the changeset viewer.