# HG changeset patch # User Richard Laager # Date 1137637245 0 # Node ID 75ac13ab161f31961d516f7ae75ca2cc23e90dba # Parent d7b9fa3b7baf23e4598574755a9e89181c3d84a7 [gaim-migrate @ 15286] Fix an info display bug (Address: is being shown and there is no information after it) I'm seeing on jabber.umn.edu committer: Tailor Script diff -r d7b9fa3b7baf -r 75ac13ab161f src/protocols/jabber/buddy.c --- a/src/protocols/jabber/buddy.c Thu Jan 19 00:59:25 2006 +0000 +++ b/src/protocols/jabber/buddy.c Thu Jan 19 02:20:45 2006 +0000 @@ -697,10 +697,8 @@ g_string_append_printf(info_text, "%s: %s
", _("Birthday"), text); } else if(!strcmp(child->name, "ADR")) { - /* show which address it is */ - if(child->child) - g_string_append_printf(info_text, "%s:
", - _("Address")); + gboolean address_line_added = FALSE; + for(child2 = child->child; child2; child2 = child2->next) { char *text2; @@ -709,32 +707,44 @@ continue; text2 = xmlnode_get_data(child2); - if(text2 && !strcmp(child2->name, "POBOX")) { + if (text2 == NULL) + continue; + + /* We do this here so that it's not added if all the child + * elements are empty. */ + if (!address_line_added) + { + g_string_append_printf(info_text, "%s:
", + _("Address")); + address_line_added = TRUE; + } + + if(!strcmp(child2->name, "POBOX")) { g_string_append_printf(info_text, " %s: %s
", _("P.O. Box"), text2); - } else if(text2 && !strcmp(child2->name, "EXTADR")) { + } else if(!strcmp(child2->name, "EXTADR")) { g_string_append_printf(info_text, " %s: %s
", _("Extended Address"), text2); - } else if(text2 && !strcmp(child2->name, "STREET")) { + } else if(!strcmp(child2->name, "STREET")) { g_string_append_printf(info_text, " %s: %s
", _("Street Address"), text2); - } else if(text2 && !strcmp(child2->name, "LOCALITY")) { + } else if(!strcmp(child2->name, "LOCALITY")) { g_string_append_printf(info_text, " %s: %s
", _("Locality"), text2); - } else if(text2 && !strcmp(child2->name, "REGION")) { + } else if(!strcmp(child2->name, "REGION")) { g_string_append_printf(info_text, " %s: %s
", _("Region"), text2); - } else if(text2 && !strcmp(child2->name, "PCODE")) { + } else if(!strcmp(child2->name, "PCODE")) { g_string_append_printf(info_text, " %s: %s
", _("Postal Code"), text2); - } else if(text2 && (!strcmp(child2->name, "CTRY") - || !strcmp(child2->name, "COUNTRY"))) { + } else if(!strcmp(child2->name, "CTRY") + || !strcmp(child2->name, "COUNTRY")) { g_string_append_printf(info_text, " %s: %s
", _("Country"), text2);