Changeset 06b5893


Ignore:
Timestamp:
2011-12-07T21:47:25Z (7 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
57da960
Parents:
aee8c19
Message:

Merging non-SASL authentication patch from #863. This also implements
hidden-default settings, which means a setting is hidden unless it was
changed from the default. This seems like appropriate behaviour for
something as obscure as this.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    raee8c19 r06b5893  
    212212                                   this is an old server that can't do SASL
    213213                                   authentication. */
    214                                 if( !sasl_supported( ic ) )
     214                                if( !set_getbool( &ic->acc->set, "sasl") || !sasl_supported( ic ) )
    215215                                {
    216216                                        /* If there's no version= tag, we suppose
     
    375375           other way. jabber.com doesn't seem to do SASL while it pretends
    376376           to be XMPP 1.0 compliant! */
    377         else if( !( jd->flags & JFLAG_AUTHENTICATED ) && sasl_supported( ic ) )
     377        else if( !( jd->flags & JFLAG_AUTHENTICATED ) && set_getbool( &ic->acc->set, "sasl") && sasl_supported( ic ) )
    378378        {
    379379                if( !jabber_init_iq_auth( ic ) )
  • protocols/jabber/jabber.c

    raee8c19 r06b5893  
    8282        s->flags |= ACC_SET_OFFLINE_ONLY;
    8383       
     84        s = set_add( &acc->set, "sasl", "true", set_eval_bool, acc );
     85        s->flags |= ACC_SET_OFFLINE_ONLY | SET_HIDDEN_DEFAULT;
     86
    8487        s = set_add( &acc->set, "user_agent", "BitlBee", NULL, acc );
    8588       
  • root_commands.c

    raee8c19 r06b5893  
    362362                while( s )
    363363                {
    364                         if( !( s->flags & SET_HIDDEN ) )
     364                        if( set_isvisible( s ) )
    365365                                cmd_showset( irc, &s, s->key );
    366366                        s = s->next;
  • set.c

    raee8c19 r06b5893  
    112112}
    113113
     114int set_isvisible( set_t *set )
     115{
     116        /* the default value is not stored in value, only in def */
     117        return !( ( set->flags & SET_HIDDEN ) ||
     118                  ( ( set->flags & SET_HIDDEN_DEFAULT ) &&
     119                    ( set->value == NULL ) ) );
     120}
     121
    114122int set_setstr( set_t **head, const char *key, char *value )
    115123{
  • set.h

    raee8c19 r06b5893  
    4949        SET_HIDDEN = 0x0200,
    5050        SET_PASSWORD = 0x0400,
     51        SET_HIDDEN_DEFAULT = 0x0800,
    5152} set_flags_t;
    5253
     
    9899int set_reset( set_t **head, const char *key );
    99100
     101/* returns true if a setting shall be shown to the user */
     102int set_isvisible( set_t *set );
     103
    100104/* Two very useful generic evaluators. */
    101105char *set_eval_int( set_t *set, char *value );
Note: See TracChangeset for help on using the changeset viewer.