comparison src/protocols/jabber/chat.c @ 7926:68900f9cb540

[gaim-migrate @ 8597] tweak tweaky tweak committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 24 Dec 2003 01:48:25 +0000
parents e87e7d9d0132
children 119a22025818
comparison
equal deleted inserted replaced
7925:2014b91db201 7926:68900f9cb540
288 static void jabber_chat_room_configure_cb(JabberStream *js, xmlnode *packet, gpointer data) 288 static void jabber_chat_room_configure_cb(JabberStream *js, xmlnode *packet, gpointer data)
289 { 289 {
290 xmlnode *query, *x; 290 xmlnode *query, *x;
291 const char *type = xmlnode_get_attrib(packet, "type"); 291 const char *type = xmlnode_get_attrib(packet, "type");
292 const char *from = xmlnode_get_attrib(packet, "from"); 292 const char *from = xmlnode_get_attrib(packet, "from");
293 char *msg;
293 JabberChat *chat; 294 JabberChat *chat;
294 JabberID *jid; 295 JabberID *jid;
295 296
296 if(!type || !from) 297 if(!type || !from)
297 return; 298 return;
299
298 300
299 301
300 if(!strcmp(type, "result")) { 302 if(!strcmp(type, "result")) {
301 jid = jabber_id_new(from); 303 jid = jabber_id_new(from);
302 304
323 if(!strcmp(xmlns, "jabber:x:data")) { 325 if(!strcmp(xmlns, "jabber:x:data")) {
324 jabber_x_data_request(js, x, jabber_chat_room_configure_x_data_cb, chat); 326 jabber_x_data_request(js, x, jabber_chat_room_configure_x_data_cb, chat);
325 return; 327 return;
326 } 328 }
327 } 329 }
328 } else { 330 } else if(!strcmp(type, "error")) {
329 /* XXX: handle errors */ 331 xmlnode *errnode = xmlnode_get_child(packet, "error");
332 const char *code = NULL;
333 char *code_txt = NULL;
334 char *msg;
335 char *text = NULL;
336
337 if(errnode) {
338 code = xmlnode_get_attrib(errnode, "code");
339 text = xmlnode_get_data(errnode);
340 }
341
342 if(code)
343 code_txt = g_strdup_printf(_(" (Code %s)"), code);
344
345 msg = g_strdup_printf("%s%s", text ? text : "", code_txt ? code_txt : "");
346 gaim_notify_error(js->gc, _("Configuration error"), _("Configuration error"), msg);
347
348 g_free(msg);
349 if(code_txt)
350 g_free(code_txt);
351
352 return;
330 } 353 }
331 354
355 msg = g_strdup_printf("Unable to configure room %s", from);
356
357 gaim_notify_info(js->gc, _("Unable to configure"), _("Unable to configure"), msg);
358 g_free(msg);
332 359
333 } 360 }
334 361
335 void jabber_chat_request_room_configure(JabberChat *chat) { 362 void jabber_chat_request_room_configure(JabberChat *chat) {
336 JabberIq *iq; 363 JabberIq *iq;