Changeset 529078a


Ignore:
Timestamp:
2007-12-16T16:35:38Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
fb4ebcc5
Parents:
3e79889
Message:

Implemented XEP-0199 (patch from misc@…).

Location:
protocols/jabber
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r3e79889 r529078a  
    5050        else if( strcmp( type, "get" ) == 0 )
    5151        {
    52                 if( !( c = xt_find_node( node->children, "query" ) ) ||
     52                if( !( ( c = xt_find_node( node->children, "query" ) ) ||
     53                       ( c = xt_find_node( node->children, "ping" ) ) ) || /* O_o WHAT is wrong with just <query/> ????? */
    5354                    !( s = xt_find_attr( c, "xmlns" ) ) )
    5455                {
     
    8182                        xt_add_child( reply, xt_new_node( "tz", buf, NULL ) );
    8283                }
     84                else if( strcmp( s, XMLNS_PING ) == 0 )
     85                {
     86                        xt_free_node( reply );
     87                        reply = jabber_make_packet( "iq", "result", xt_find_attr( node, "from" ), NULL );
     88                        if( ( s = xt_find_attr( node, "id" ) ) )
     89                                xt_add_attr( reply, "id", s );
     90                        pack = 0;
     91                }
    8392                else if( strcmp( s, XMLNS_DISCOVER ) == 0 )
    8493                {
     
    8796                                                   XMLNS_CHATSTATES,
    8897                                                   XMLNS_MUC,
     98                                                   XMLNS_PING,
    8999                                                   NULL };
    90100                        const char **f;
  • protocols/jabber/jabber.h

    r3e79889 r529078a  
    152152#define XMLNS_VERSION      "jabber:iq:version"                  /* XEP-0092 */
    153153#define XMLNS_TIME         "jabber:iq:time"                     /* XEP-0090 */
     154#define XMLNS_PING         "urn:xmpp:ping"                      /* XEP-0199 */
    154155#define XMLNS_VCARD        "vcard-temp"                         /* XEP-0054 */
    155156#define XMLNS_DELAY        "jabber:x:delay"                     /* XEP-0091 */
Note: See TracChangeset for help on using the changeset viewer.