Ignore:
Timestamp:
2007-07-01T13:08:47Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2758cfe
Parents:
7bf4326
Message:

Less copy-pasting in the service discovery reply and added MUC support to
that list. And adding some const stuff in the xmltree functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r7bf4326 r40ef702  
    9999                else if( strcmp( s, XMLNS_DISCOVER ) == 0 )
    100100                {
     101                        const char *features[] = { XMLNS_VERSION,
     102                                                   XMLNS_TIME,
     103                                                   XMLNS_CHATSTATES,
     104                                                   XMLNS_MUC,
     105                                                   NULL };
     106                        const char **f;
     107                       
    101108                        c = xt_new_node( "identity", NULL, NULL );
    102109                        xt_add_attr( c, "category", "client" );
     
    105112                        xt_add_child( reply, c );
    106113                       
    107                         c = xt_new_node( "feature", NULL, NULL );
    108                         xt_add_attr( c, "var", XMLNS_VERSION );
    109                         xt_add_child( reply, c );
    110                        
    111                         c = xt_new_node( "feature", NULL, NULL );
    112                         xt_add_attr( c, "var", XMLNS_TIME );
    113                         xt_add_child( reply, c );
    114                        
    115                         c = xt_new_node( "feature", NULL, NULL );
    116                         xt_add_attr( c, "var", XMLNS_CHATSTATES );
    117                         xt_add_child( reply, c );
    118                        
    119                         /* Later this can be useful to announce things like
    120                            MUC support. */
     114                        for( f = features; *f; f ++ )
     115                        {
     116                                c = xt_new_node( "feature", NULL, NULL );
     117                                xt_add_attr( c, "var", *f );
     118                                xt_add_child( reply, c );
     119                        }
    121120                }
    122121                else
Note: See TracChangeset for help on using the changeset viewer.