diff options
Diffstat (limited to 'protocols/jabber/jabber_util.c')
-rw-r--r-- | protocols/jabber/jabber_util.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c index 3a0d2004..6764e7b3 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -25,42 +25,32 @@ static int next_id = 1; -char *set_eval_resprio( set_t *set, char *value ) +char *set_eval_priority( set_t *set, char *value ) { account_t *acc = set->data; char *ret; - if( strcmp( set->key, "priority" ) == 0 ) - ret = set_eval_int( set, value ); - else - ret = value; + ret = set_eval_int( set, value ); /* Only run this stuff if the account is online ATM, and if the setting seems to be acceptable. */ if( acc->gc && ret ) { - if( strcmp( set->key, "priority" ) == 0 ) - { - /* Although set_eval functions usually are very nice - and convenient, they have one disadvantage: If I - would just call p_s_u() now to send the new prio - setting, it would send the old setting because the - set->value gets changed when the eval returns a - non-NULL value. - - So now I can choose between implementing post-set - functions next to evals, or just do this little - hack: */ - g_free( set->value ); - set->value = g_strdup( ret ); - - /* (Yes, sorry, I prefer the hack. :-P) */ - - presence_send_update( acc->gc ); - } - else - { - } + /* Although set_eval functions usually are very nice and + convenient, they have one disadvantage: If I would just + call p_s_u() now to send the new prio setting, it would + send the old setting because the set->value gets changed + when the eval returns a non-NULL value. + + So now I can choose between implementing post-set + functions next to evals, or just do this little hack: */ + + g_free( set->value ); + set->value = g_strdup( ret ); + + /* (Yes, sorry, I prefer the hack. :-P) */ + + presence_send_update( acc->gc ); } return ret; |