Changeset 3314ced


Ignore:
Timestamp:
2015-10-21T11:40:58Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
12f041d
Parents:
09f7ec1
Message:

jabber: set BEE_USER_NOOTR flag to _xmlconsole

Fixes trac ticket 1111, https://bugs.bitlbee.org/bitlbee/ticket/1111

One of the most annoying issues. You're trying to debug stuff and it
just crashes even harder than without the debug enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r09f7ec1 r3314ced  
    200200}
    201201
     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;
     213        }
     214}
     215
    202216/* Separate this from jabber_login() so we can do OAuth first if necessary.
    203217   Putting this in io.c would probably be more correct. */
     
    266280
    267281        if (set_getbool(&acc->set, "xmlconsole")) {
    268                 jd->flags |= JFLAG_XMLCONSOLE;
    269                 /* Shouldn't really do this at this stage already, maybe. But
    270                    I think this shouldn't break anything. */
    271                 imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL);
     282                jabber_xmlconsole_enable(ic);
    272283        }
    273284
     
    474485static void jabber_add_buddy(struct im_connection *ic, char *who, char *group)
    475486{
    476         struct jabber_data *jd = ic->proto_data;
    477 
    478487        if (g_strcasecmp(who, JABBER_XMLCONSOLE_HANDLE) == 0) {
    479                 jd->flags |= JFLAG_XMLCONSOLE;
    480                 imcb_add_buddy(ic, JABBER_XMLCONSOLE_HANDLE, NULL);
     488                jabber_xmlconsole_enable(ic);
    481489                return;
    482490        }
Note: See TracChangeset for help on using the changeset viewer.