diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-01 14:08:47 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-01 14:08:47 +0100 |
commit | 40ef702d3e500eb38d7410114ace54e8a70b151e (patch) | |
tree | fdbd49c24d69d822afe9a41d282524bde2627359 /protocols/jabber/iq.c | |
parent | 7bf4326f7a9b2a2aec8b292ecbc876d4349d2624 (diff) |
Less copy-pasting in the service discovery reply and added MUC support to
that list. And adding some const stuff in the xmltree functions.
Diffstat (limited to 'protocols/jabber/iq.c')
-rw-r--r-- | protocols/jabber/iq.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index e5c5dde2..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 { |