Changeset ebe7b36 for protocols


Ignore:
Timestamp:
2006-09-25T10:10:14Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
281859e
Parents:
eab2ac4
Message:

Changing the resource string while online probably doesn't work.

Location:
protocols/jabber
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    reab2ac4 rebe7b36  
    4040        s->flags |= ACC_SET_OFFLINE_ONLY;
    4141       
    42         s = set_add( &acc->set, "priority", "0", set_eval_resprio, acc );
    43        
    44         s = set_add( &acc->set, "resource", "BitlBee", set_eval_resprio, acc );
     42        s = set_add( &acc->set, "priority", "0", set_eval_priority, acc );
     43       
     44        s = set_add( &acc->set, "resource", "BitlBee", NULL, acc );
     45        s->flags |= ACC_SET_OFFLINE_ONLY;
    4546       
    4647        s = set_add( &acc->set, "server", NULL, set_eval_account, acc );
     
    234235}
    235236
     237/* XMPP doesn't have both a block- and and allow-list, so these two functions
     238   will be no-ops: */
    236239static void jabber_add_deny( struct gaim_connection *gc, char *who )
    237240{
  • protocols/jabber/jabber.h

    reab2ac4 rebe7b36  
    8585
    8686/* jabber_util.c */
    87 char *set_eval_resprio( set_t *set, char *value );
     87char *set_eval_priority( set_t *set, char *value );
    8888char *set_eval_tls( set_t *set, char *value );
    8989struct xt_node *jabber_make_packet( char *name, char *type, char *to, struct xt_node *children );
  • protocols/jabber/jabber_util.c

    reab2ac4 rebe7b36  
    2626static int next_id = 1;
    2727
    28 char *set_eval_resprio( set_t *set, char *value )
     28char *set_eval_priority( set_t *set, char *value )
    2929{
    3030        account_t *acc = set->data;
    3131        char *ret;
    3232       
    33         if( strcmp( set->key, "priority" ) == 0 )
    34                 ret = set_eval_int( set, value );
    35         else
    36                 ret = value;
     33        ret = set_eval_int( set, value );
    3734       
    3835        /* Only run this stuff if the account is online ATM,
     
    4037        if( acc->gc && ret )
    4138        {
    42                 if( strcmp( set->key, "priority" ) == 0 )
    43                 {
    44                         /* Although set_eval functions usually are very nice
    45                            and convenient, they have one disadvantage: If I
    46                            would just call p_s_u() now to send the new prio
    47                            setting, it would send the old setting because the
    48                            set->value gets changed when the eval returns a
    49                            non-NULL value.
    50                            
    51                            So now I can choose between implementing post-set
    52                            functions next to evals, or just do this little
    53                            hack: */
    54                         g_free( set->value );
    55                         set->value = g_strdup( ret );
    56                        
    57                         /* (Yes, sorry, I prefer the hack. :-P) */
    58                        
    59                         presence_send_update( acc->gc );
    60                 }
    61                 else
    62                 {
    63                 }
     39                /* Although set_eval functions usually are very nice and
     40                   convenient, they have one disadvantage: If I would just
     41                   call p_s_u() now to send the new prio setting, it would
     42                   send the old setting because the set->value gets changed
     43                   when the eval returns a non-NULL value.
     44                   
     45                   So now I can choose between implementing post-set
     46                   functions next to evals, or just do this little hack: */
     47               
     48                g_free( set->value );
     49                set->value = g_strdup( ret );
     50               
     51                /* (Yes, sorry, I prefer the hack. :-P) */
     52               
     53                presence_send_update( acc->gc );
    6454        }
    6555       
Note: See TracChangeset for help on using the changeset viewer.