comparison mcabber/src/jab_iq.c @ 1002:dd9e7eb5f8a8

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