comparison src/protocols/jabber/buddy.c @ 7145:0e4894b3e2a6

[gaim-migrate @ 7712] all sorts of fun jabber stuff including: 1. stop calling gaim_strdup_withhtml() with NULL values 2. real support for headline-type messages 3. fix a stupid presence bug when authorizing people 4. fix login default stuff so people can log in committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 04 Oct 2003 21:19:29 +0000
parents 6c8706109f92
children dee9f6aebbf3
comparison
equal deleted inserted replaced
7144:4d5b0c1f2e7a 7145:0e4894b3e2a6
555 from); 555 from);
556 556
557 if(resource_name) { 557 if(resource_name) {
558 jbr = jabber_buddy_find_resource(jb, resource_name); 558 jbr = jabber_buddy_find_resource(jb, resource_name);
559 if(jbr) { 559 if(jbr) {
560 char *purdy = gaim_strdup_withhtml(jbr->status); 560 char *purdy = NULL;
561 if(jbr->status)
562 purdy = gaim_strdup_withhtml(jbr->status);
561 g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/>\n", 563 g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/>\n",
562 _("Status"), jabber_get_state_string(jbr->state), 564 _("Status"), jabber_get_state_string(jbr->state),
563 purdy ? ": " : "", 565 purdy ? ": " : "",
564 purdy ? purdy : ""); 566 purdy ? purdy : "");
565 g_free(purdy); 567 if(purdy)
568 g_free(purdy);
566 } else { 569 } else {
567 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", 570 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n",
568 _("Status"), _("Unknown")); 571 _("Status"), _("Unknown"));
569 } 572 }
570 } else { 573 } else {
571 for(resources = jb->resources; resources; resources = resources->next) { 574 for(resources = jb->resources; resources; resources = resources->next) {
572 char *purdy; 575 char *purdy = NULL;
573 jbr = resources->data; 576 jbr = resources->data;
574 purdy = gaim_strdup_withhtml(jbr->status); 577 if(jbr->status)
578 purdy = gaim_strdup_withhtml(jbr->status);
575 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n", 579 g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n",
576 _("Resource"), jbr->name); 580 _("Resource"), jbr->name);
577 g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/><br/>\n", 581 g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/><br/>\n",
578 _("Status"), jabber_get_state_string(jbr->state), 582 _("Status"), jabber_get_state_string(jbr->state),
579 purdy ? ": " : "", 583 purdy ? ": " : "",
580 purdy ? purdy : ""); 584 purdy ? purdy : "");
581 g_free(purdy); 585 if(purdy)
586 g_free(purdy);
582 } 587 }
583 } 588 }
584 589
585 if((vcard = xmlnode_get_child(packet, "vCard"))) { 590 if((vcard = xmlnode_get_child(packet, "vCard"))) {
586 xmlnode *child; 591 xmlnode *child;