Changeset d76e12f
- Timestamp:
- 2010-12-06T00:18:27Z (14 years ago)
- Branches:
- master
- Children:
- a97a336
- Parents:
- d88c92a
- Location:
- protocols/jabber
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
rd88c92a rd76e12f 51 51 { 52 52 if( !( ( c = xt_find_node( node->children, "query" ) ) || 53 ( c = xt_find_node( node->children, "ping" ) ) ) || 53 ( c = xt_find_node( node->children, "ping" ) ) || 54 ( c = xt_find_node( node->children, "time" ) ) ) || 54 55 !( s = xt_find_attr( c, "xmlns" ) ) ) 55 56 { … … 69 70 xt_add_child( reply, xt_new_node( "os", ARCH, NULL ) ); 70 71 } 71 else if( strcmp( s, XMLNS_TIME ) == 0 )72 else if( strcmp( s, XMLNS_TIME_OLD ) == 0 ) 72 73 { 73 74 time_t time_ep; … … 82 83 strftime( buf, sizeof( buf ) - 1, "%Z", localtime( &time_ep ) ); 83 84 xt_add_child( reply, xt_new_node( "tz", buf, NULL ) ); 85 } 86 else if( strcmp( s, XMLNS_TIME ) == 0 ) 87 { 88 time_t time_ep; 89 char buf[1024]; 90 91 buf[sizeof(buf)-1] = 0; 92 time_ep = time( NULL ); 93 94 xt_free_node( reply ); 95 reply = xt_new_node( "time", NULL, NULL ); 96 xt_add_attr( reply, "xmlns", XMLNS_TIME ); 97 98 strftime( buf, sizeof( buf ) - 1, "%Y%m%dT%H:%M:%SZ", gmtime( &time_ep ) ); 99 xt_add_child( reply, xt_new_node( "utc", buf, NULL ) ); 100 101 strftime( buf, sizeof( buf ) - 1, "%z", localtime( &time_ep ) ); 102 if( strlen( buf ) >= 5 ) 103 { 104 buf[6] = '\0'; 105 buf[5] = buf[4]; 106 buf[4] = buf[3]; 107 buf[3] = ':'; 108 } 109 xt_add_child( reply, xt_new_node( "tzo", buf, NULL ) ); 84 110 } 85 111 else if( strcmp( s, XMLNS_PING ) == 0 ) … … 95 121 const char *features[] = { XMLNS_DISCO_INFO, 96 122 XMLNS_VERSION, 123 XMLNS_TIME_OLD, 97 124 XMLNS_TIME, 98 125 XMLNS_CHATSTATES, -
protocols/jabber/jabber.h
rd88c92a rd76e12f 214 214 #define XMLNS_AUTH "jabber:iq:auth" /* XEP-0078 */ 215 215 #define XMLNS_VERSION "jabber:iq:version" /* XEP-0092 */ 216 #define XMLNS_TIME "jabber:iq:time" /* XEP-0090 */ 216 #define XMLNS_TIME_OLD "jabber:iq:time" /* XEP-0090 */ 217 #define XMLNS_TIME "urn:xmpp:time" /* XEP-0202 */ 217 218 #define XMLNS_PING "urn:xmpp:ping" /* XEP-0199 */ 218 219 #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */
Note: See TracChangeset
for help on using the changeset viewer.