aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/iq.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-11-19 23:16:18 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-11-19 23:16:18 +0000
commit256899f2f9eaa43610af53704d5c7ccbd1aace3b (patch)
tree080ec69cc51b963efcd5002d9a15ec2f92df3d16 /protocols/jabber/iq.c
parentcd428e473fe4428041722fd373badef890edebd9 (diff)
parentef5c1855b406e462fb8b90b517f1672a47bcc4b5 (diff)
Merging Jabber groupchat support.
Diffstat (limited to 'protocols/jabber/iq.c')
-rw-r--r--protocols/jabber/iq.c35
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 );
}
}