Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision 5e202b09f2cd9faff5f316ae6804facb5342eace)
+++ protocols/jabber/jabber.c	(revision 172a73f1a4b37fa20d1d50496a3faccb8fe6c769)
@@ -152,5 +152,5 @@
 	jd->away_message = ( message && *message ) ? g_strdup( message ) : NULL;
 	
-	presence_send( gc, NULL, jd->away_state->code, jd->away_message );
+	presence_send_update( gc );
 }
 
Index: protocols/jabber/jabber.h
===================================================================
--- protocols/jabber/jabber.h	(revision 5e202b09f2cd9faff5f316ae6804facb5342eace)
+++ protocols/jabber/jabber.h	(revision 172a73f1a4b37fa20d1d50496a3faccb8fe6c769)
@@ -54,4 +54,7 @@
 	char *username;		/* USERNAME@server */
 	char *server;		/* username@SERVER -=> server/domain, not hostname */
+	
+	/* After changing one of these two (or the priority setting), call
+	   presence_send_update() to inform the server about the changes. */
 	struct jabber_away_state *away_state;
 	char *away_message;
@@ -75,5 +78,5 @@
 /* presence.c */
 xt_status jabber_pkt_presence( struct xt_node *node, gpointer data );
-int presence_send( struct gaim_connection *gc, char *to, char *show, char *status );
+int presence_send_update( struct gaim_connection *gc );
 
 /* jabber_util.c */
Index: protocols/jabber/jabber_util.c
===================================================================
--- protocols/jabber/jabber_util.c	(revision 5e202b09f2cd9faff5f316ae6804facb5342eace)
+++ protocols/jabber/jabber_util.c	(revision 172a73f1a4b37fa20d1d50496a3faccb8fe6c769)
@@ -29,15 +29,40 @@
 {
 	account_t *acc = set->data;
+	char *ret;
 	
-	/* Only run this stuff if the account is online ATM. */
-	if( acc->gc )
+	if( strcmp( set->key, "priority" ) == 0 )
+		ret = set_eval_int( set, value );
+	else
+		ret = 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
+		{
+		}
 	}
 	
-	if( g_strcasecmp( set->key, "priority" ) == 0 )
-		return set_eval_int( set, value );
-	else
-		return value;
+	return ret;
 }
 
Index: protocols/jabber/presence.c
===================================================================
--- protocols/jabber/presence.c	(revision 5e202b09f2cd9faff5f316ae6804facb5342eace)
+++ protocols/jabber/presence.c	(revision 172a73f1a4b37fa20d1d50496a3faccb8fe6c769)
@@ -54,14 +54,22 @@
 }
 
-int presence_send( struct gaim_connection *gc, char *to, char *show, char *status )
+/* Whenever presence information is updated, call this function to inform the
+   server. */
+int presence_send_update( struct gaim_connection *gc )
 {
+	struct jabber_data *jd = gc->proto_data;
 	struct xt_node *node;
+	char *show = jd->away_state->code;
+	char *status = jd->away_message;
 	int st;
 	
-	node = jabber_make_packet( "presence", NULL, to, NULL );
+	node = jabber_make_packet( "presence", NULL, NULL, NULL );
 	if( show && *show )
 		xt_add_child( node, xt_new_node( "show", show, NULL ) );
 	if( status )
 		xt_add_child( node, xt_new_node( "status", status, NULL ) );
+	/* if( set_getint( &gc->acc->set, "priority" ) != 0 ) */
+	/* Let's just send this every time... */
+		xt_add_child( node, xt_new_node( "priority", set_getstr( &gc->acc->set, "priority" ), NULL ) );
 	
 	st = jabber_write_packet( gc, node );
