diff options
Diffstat (limited to 'protocols/jabber/iq.c')
| -rw-r--r-- | protocols/jabber/iq.c | 35 | 
1 files changed, 16 insertions, 19 deletions
| diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index 2aa9d432..4738817a 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -98,26 +98,25 @@ xt_status jabber_pkt_iq( struct xt_node *node, gpointer data )  		}  		else if( strcmp( s, XMLNS_DISCOVER ) == 0 )  		{ +			const char *features[] = { XMLNS_VERSION, +			                           XMLNS_TIME, +			                           XMLNS_CHATSTATES, +			                           XMLNS_MUC, +			                           NULL }; +			const char **f; +			  			c = xt_new_node( "identity", NULL, NULL );  			xt_add_attr( c, "category", "client" );  			xt_add_attr( c, "type", "pc" );  			xt_add_attr( c, "name", "BitlBee" );  			xt_add_child( reply, c ); -			c = xt_new_node( "feature", NULL, NULL ); -			xt_add_attr( c, "var", XMLNS_VERSION ); -			xt_add_child( reply, c ); -			 -			c = xt_new_node( "feature", NULL, NULL ); -			xt_add_attr( c, "var", XMLNS_TIME ); -			xt_add_child( reply, c ); -			 -			c = xt_new_node( "feature", NULL, NULL ); -			xt_add_attr( c, "var", XMLNS_CHATSTATES ); -			xt_add_child( reply, c ); -			 -			/* Later this can be useful to announce things like -			   MUC support. */ +			for( f = features; *f; f ++ ) +			{ +				c = xt_new_node( "feature", NULL, NULL ); +				xt_add_attr( c, "var", *f ); +				xt_add_child( reply, c ); +			}  		}  		else  		{ @@ -372,15 +371,13 @@ static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *  					imcb_add_buddy( ic, jid, ( group && group->text_len ) ?  					                           group->text : NULL ); -				imcb_rename_buddy( ic, jid, name ); +				if( name ) +					imcb_rename_buddy( ic, jid, name );  			}  			else if( strcmp( sub, "remove" ) == 0 )  			{ -				/* Don't have any API call for this yet! So let's -				   just try to handle this as well as we can. */  				jabber_buddy_remove_bare( ic, jid ); -				imcb_buddy_status( ic, jid, 0, NULL, NULL ); -				/* FIXME! */ +				imcb_remove_buddy( ic, jid, NULL );  			}  		} | 
