comparison mcabber/src/jab_iq.c @ 1030:923cf5a92b44

[BP-dd9e7eb5f8a8] Remove old UTF-8 conversions
author Mikael Berthe <mikael@lilotux.net>
date Thu, 16 Nov 2006 19:30:12 +0100
parents 1bdf0f1b16c0
children f7ef8003fc35
comparison
equal deleted inserted replaced
1029:1d35e297a8c4 1030:923cf5a92b44
227 } 227 }
228 228
229 static void iqscallback_version(eviqs *iqp, xmlnode xml_result, guint iqcontext) 229 static void iqscallback_version(eviqs *iqp, xmlnode xml_result, guint iqcontext)
230 { 230 {
231 xmlnode ansqry; 231 xmlnode ansqry;
232 char *p, *p_noutf8; 232 char *p;
233 char *bjid; 233 char *bjid;
234 char *buf; 234 char *buf;
235 235
236 // Leave now if we cannot process xml_result 236 // Leave now if we cannot process xml_result
237 if (!xml_result || iqcontext) return; 237 if (!xml_result || iqcontext) return;
260 g_free(buf); 260 g_free(buf);
261 261
262 // Get result data... 262 // Get result data...
263 p = xmlnode_get_tag_data(ansqry, "name"); 263 p = xmlnode_get_tag_data(ansqry, "name");
264 if (p) { 264 if (p) {
265 p_noutf8 = from_utf8(p); 265 buf = g_strdup_printf("Name: %s", p);
266 if (p_noutf8) { 266 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
267 buf = g_strdup_printf("Name: %s", p_noutf8); 267 g_free(buf);
268 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
269 g_free(p_noutf8);
270 g_free(buf);
271 }
272 } 268 }
273 p = xmlnode_get_tag_data(ansqry, "version"); 269 p = xmlnode_get_tag_data(ansqry, "version");
274 if (p) { 270 if (p) {
275 p_noutf8 = from_utf8(p); 271 buf = g_strdup_printf("Version: %s", p);
276 if (p_noutf8) { 272 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
277 buf = g_strdup_printf("Version: %s", p_noutf8); 273 g_free(buf);
278 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
279 g_free(p_noutf8);
280 g_free(buf);
281 }
282 } 274 }
283 p = xmlnode_get_tag_data(ansqry, "os"); 275 p = xmlnode_get_tag_data(ansqry, "os");
284 if (p) { 276 if (p) {
285 p_noutf8 = from_utf8(p); 277 buf = g_strdup_printf("OS: %s", p);
286 if (p_noutf8) { 278 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
287 buf = g_strdup_printf("OS: %s", p_noutf8); 279 g_free(buf);
288 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
289 g_free(p_noutf8);
290 g_free(buf);
291 }
292 } 280 }
293 } 281 }
294 282
295 void request_version(const char *fulljid) 283 void request_version(const char *fulljid)
296 { 284 {
303 } 291 }
304 292
305 static void iqscallback_time(eviqs *iqp, xmlnode xml_result, guint iqcontext) 293 static void iqscallback_time(eviqs *iqp, xmlnode xml_result, guint iqcontext)
306 { 294 {
307 xmlnode ansqry; 295 xmlnode ansqry;
308 char *p, *p_noutf8; 296 char *p;
309 char *bjid; 297 char *bjid;
310 char *buf; 298 char *buf;
311 299
312 // Leave now if we cannot process xml_result 300 // Leave now if we cannot process xml_result
313 if (!xml_result || iqcontext) return; 301 if (!xml_result || iqcontext) return;
336 g_free(buf); 324 g_free(buf);
337 325
338 // Get result data... 326 // Get result data...
339 p = xmlnode_get_tag_data(ansqry, "utc"); 327 p = xmlnode_get_tag_data(ansqry, "utc");
340 if (p) { 328 if (p) {
341 p_noutf8 = from_utf8(p); 329 buf = g_strdup_printf("UTC: %s", p);
342 if (p_noutf8) { 330 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
343 buf = g_strdup_printf("UTC: %s", p_noutf8); 331 g_free(buf);
344 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
345 g_free(p_noutf8);
346 g_free(buf);
347 }
348 } 332 }
349 p = xmlnode_get_tag_data(ansqry, "tz"); 333 p = xmlnode_get_tag_data(ansqry, "tz");
350 if (p) { 334 if (p) {
351 p_noutf8 = from_utf8(p); 335 buf = g_strdup_printf("TZ: %s", p);
352 if (p_noutf8) { 336 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
353 buf = g_strdup_printf("TZ: %s", p_noutf8); 337 g_free(buf);
354 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
355 g_free(p_noutf8);
356 g_free(buf);
357 }
358 } 338 }
359 p = xmlnode_get_tag_data(ansqry, "display"); 339 p = xmlnode_get_tag_data(ansqry, "display");
360 if (p) { 340 if (p) {
361 p_noutf8 = from_utf8(p); 341 buf = g_strdup_printf("Time: %s", p);
362 if (p_noutf8) { 342 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
363 buf = g_strdup_printf("Time: %s", p_noutf8); 343 g_free(buf);
364 scr_WriteIncomingMessage(bjid, buf, 0, HBB_PREFIX_NONE);
365 g_free(p_noutf8);
366 g_free(buf);
367 }
368 } 344 }
369 } 345 }
370 346
371 void request_time(const char *fulljid) 347 void request_time(const char *fulljid)
372 { 348 {