src/protocols/jabber/iq.c

changeset 13105
8f9c66e4af87
parent 12284
2cb693d740d5
child 13794
7264393a2349
--- a/src/protocols/jabber/iq.c	Thu Feb 02 19:39:12 2006 +0000
+++ b/src/protocols/jabber/iq.c	Thu Feb 02 19:50:51 2006 +0000
@@ -167,7 +167,6 @@
 {
 	const char *type, *from, *id;
 	JabberIq *iq;
-	char buf[1024];
 	xmlnode *query;
 	time_t now_t;
 	struct tm *now;
@@ -180,7 +179,7 @@
 	id = xmlnode_get_attrib(packet, "id");
 
 	if(type && !strcmp(type, "get")) {
-		char *utf8;
+		const char *date;
 
 		iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "jabber:iq:time");
 		jabber_iq_set_id(iq, id);
@@ -188,20 +187,14 @@
 
 		query = xmlnode_get_child(iq->node, "query");
 
-		strftime(buf, sizeof(buf), "%Y%m%dT%T", now);
-		xmlnode_insert_data(xmlnode_new_child(query, "utc"), buf, -1);
+		date = gaim_utf8_strftime("%Y%m%dT%T", now);
+		xmlnode_insert_data(xmlnode_new_child(query, "utc"), date, -1);
 
-		strftime(buf, sizeof(buf), "%Z", now);
-		if((utf8 = gaim_utf8_try_convert(buf))) {
-			xmlnode_insert_data(xmlnode_new_child(query, "tz"), utf8, -1);
-			g_free(utf8);
-		}
+		date = gaim_utf8_strftime("%Z", now);
+		xmlnode_insert_data(xmlnode_new_child(query, "tz"), date, -1);
 
-		strftime(buf, sizeof(buf), "%d %b %Y %T", now);
-		if((utf8 = gaim_utf8_try_convert(buf))) {
-			xmlnode_insert_data(xmlnode_new_child(query, "display"), utf8, -1);
-			g_free(utf8);
-		}
+		date = gaim_utf8_strftime("%d %b %Y %T", now);
+		xmlnode_insert_data(xmlnode_new_child(query, "display"), date, -1);
 
 		jabber_iq_send(iq);
 	}

mercurial