diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-09-25 12:10:14 +0200 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-09-25 12:10:14 +0200 | 
| commit | ebe7b36af555d644357efbc0e63393927162bf06 (patch) | |
| tree | f1fcf377ff52962ba904c102d617884d9c33b545 /protocols/jabber/jabber_util.c | |
| parent | eab2ac45071373751a3041c85b0ab69460109032 (diff) | |
Changing the resource string while online probably doesn't work.
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; | 
