Changeset a4effbf for protocols


Ignore:
Timestamp:
2006-10-12T21:01:51Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
7e83adca
Parents:
259edd4
Message:

Replies to jabber:iq:time packets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r259edd4 ra4effbf  
    7878                        xt_add_child( reply, xt_new_node( "version", BITLBEE_VERSION, NULL ) );
    7979                        xt_add_child( reply, xt_new_node( "os", ARCH, NULL ) );
     80                }
     81                else if( strcmp( s, "jabber:iq:time" ) == 0 )
     82                {
     83                        time_t time_ep;
     84                        char buf[1024];
     85                       
     86                        buf[sizeof(buf)-1] = 0;
     87                        time_ep = time( NULL );
     88                       
     89                        strftime( buf, sizeof( buf ) - 1, "%Y%m%dT%H:%M:%S", gmtime( &time_ep ) );
     90                        xt_add_child( reply, xt_new_node( "utc", buf, NULL ) );
     91                       
     92                        strftime( buf, sizeof( buf ) - 1, "%Z", localtime( &time_ep ) );
     93                        xt_add_child( reply, xt_new_node( "tz", buf, NULL ) );
    8094                }
    8195                else if( strcmp( s, "http://jabber.org/protocol/disco#info" ) == 0 )
     
    89103                        c = xt_new_node( "feature", NULL, NULL );
    90104                        xt_add_attr( c, "var", "jabber:iq:version" );
     105                        xt_add_child( reply, c );
     106                       
     107                        c = xt_new_node( "feature", NULL, NULL );
     108                        xt_add_attr( c, "var", "jabber:iq:time" );
    91109                        xt_add_child( reply, c );
    92110                       
Note: See TracChangeset for help on using the changeset viewer.