Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/buddy.c @ 31811:41f1e44ad4b5
propagate from branch 'im.pidgin.pidgin' (head 6f879669a6513a5c40335bbaefe842389a92b39e)
to branch 'im.pidgin.pidgin.next.minor' (head 8cdcfae03192b964373cd95a73342d30ed15d13a)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sat, 20 Nov 2010 13:02:08 +0000 |
parents | c44ec533a48c 0123c69ec0e5 |
children | ea2a155b4439 |
comparison
equal
deleted
inserted
replaced
31369:250a16f2548f | 31811:41f1e44ad4b5 |
---|---|
1019 text = xmlnode_get_data(child); | 1019 text = xmlnode_get_data(child); |
1020 if(text && !strcmp(child->name, "FN")) { | 1020 if(text && !strcmp(child->name, "FN")) { |
1021 if (!serverside_alias) | 1021 if (!serverside_alias) |
1022 serverside_alias = g_strdup(text); | 1022 serverside_alias = g_strdup(text); |
1023 | 1023 |
1024 purple_notify_user_info_add_pair(user_info, _("Full Name"), text); | 1024 purple_notify_user_info_add_pair_plaintext(user_info, _("Full Name"), text); |
1025 } else if(!strcmp(child->name, "N")) { | 1025 } else if(!strcmp(child->name, "N")) { |
1026 for(child2 = child->child; child2; child2 = child2->next) | 1026 for(child2 = child->child; child2; child2 = child2->next) |
1027 { | 1027 { |
1028 char *text2; | 1028 char *text2; |
1029 | 1029 |
1030 if(child2->type != XMLNODE_TYPE_TAG) | 1030 if(child2->type != XMLNODE_TYPE_TAG) |
1031 continue; | 1031 continue; |
1032 | 1032 |
1033 text2 = xmlnode_get_data(child2); | 1033 text2 = xmlnode_get_data(child2); |
1034 if(text2 && !strcmp(child2->name, "FAMILY")) { | 1034 if(text2 && !strcmp(child2->name, "FAMILY")) { |
1035 purple_notify_user_info_add_pair(user_info, _("Family Name"), text2); | 1035 purple_notify_user_info_add_pair_plaintext(user_info, _("Family Name"), text2); |
1036 } else if(text2 && !strcmp(child2->name, "GIVEN")) { | 1036 } else if(text2 && !strcmp(child2->name, "GIVEN")) { |
1037 purple_notify_user_info_add_pair(user_info, _("Given Name"), text2); | 1037 purple_notify_user_info_add_pair_plaintext(user_info, _("Given Name"), text2); |
1038 } else if(text2 && !strcmp(child2->name, "MIDDLE")) { | 1038 } else if(text2 && !strcmp(child2->name, "MIDDLE")) { |
1039 purple_notify_user_info_add_pair(user_info, _("Middle Name"), text2); | 1039 purple_notify_user_info_add_pair_plaintext(user_info, _("Middle Name"), text2); |
1040 } | 1040 } |
1041 g_free(text2); | 1041 g_free(text2); |
1042 } | 1042 } |
1043 } else if(text && !strcmp(child->name, "NICKNAME")) { | 1043 } else if(text && !strcmp(child->name, "NICKNAME")) { |
1044 /* Prefer the Nickcname to the Full Name as the serverside alias if it's not just part of the jid. | 1044 /* Prefer the Nickcname to the Full Name as the serverside alias if it's not just part of the jid. |
1045 * Ignore it if it's part of the jid. */ | 1045 * Ignore it if it's part of the jid. */ |
1046 if (strstr(bare_jid, text) == NULL) { | 1046 if (strstr(bare_jid, text) == NULL) { |
1047 g_free(serverside_alias); | 1047 g_free(serverside_alias); |
1048 serverside_alias = g_strdup(text); | 1048 serverside_alias = g_strdup(text); |
1049 | 1049 |
1050 purple_notify_user_info_add_pair(user_info, _("Nickname"), text); | 1050 purple_notify_user_info_add_pair_plaintext(user_info, _("Nickname"), text); |
1051 } | 1051 } |
1052 } else if(text && !strcmp(child->name, "BDAY")) { | 1052 } else if(text && !strcmp(child->name, "BDAY")) { |
1053 purple_notify_user_info_add_pair(user_info, _("Birthday"), text); | 1053 purple_notify_user_info_add_pair_plaintext(user_info, _("Birthday"), text); |
1054 } else if(!strcmp(child->name, "ADR")) { | 1054 } else if(!strcmp(child->name, "ADR")) { |
1055 gboolean address_line_added = FALSE; | 1055 gboolean address_line_added = FALSE; |
1056 | 1056 |
1057 for(child2 = child->child; child2; child2 = child2->next) | 1057 for(child2 = child->child; child2; child2 = child2->next) |
1058 { | 1058 { |
1072 purple_notify_user_info_add_section_header(user_info, _("Address")); | 1072 purple_notify_user_info_add_section_header(user_info, _("Address")); |
1073 address_line_added = TRUE; | 1073 address_line_added = TRUE; |
1074 } | 1074 } |
1075 | 1075 |
1076 if(!strcmp(child2->name, "POBOX")) { | 1076 if(!strcmp(child2->name, "POBOX")) { |
1077 purple_notify_user_info_add_pair(user_info, _("P.O. Box"), text2); | 1077 purple_notify_user_info_add_pair_plaintext(user_info, _("P.O. Box"), text2); |
1078 } else if (g_str_equal(child2->name, "EXTADD") || g_str_equal(child2->name, "EXTADR")) { | 1078 } else if (g_str_equal(child2->name, "EXTADD") || g_str_equal(child2->name, "EXTADR")) { |
1079 /* | 1079 /* |
1080 * EXTADD is correct, EXTADR is generated by other | 1080 * EXTADD is correct, EXTADR is generated by other |
1081 * clients. The next time someone reads this, remove | 1081 * clients. The next time someone reads this, remove |
1082 * EXTADR. | 1082 * EXTADR. |
1083 */ | 1083 */ |
1084 purple_notify_user_info_add_pair(user_info, _("Extended Address"), text2); | 1084 purple_notify_user_info_add_pair_plaintext(user_info, _("Extended Address"), text2); |
1085 } else if(!strcmp(child2->name, "STREET")) { | 1085 } else if(!strcmp(child2->name, "STREET")) { |
1086 purple_notify_user_info_add_pair(user_info, _("Street Address"), text2); | 1086 purple_notify_user_info_add_pair_plaintext(user_info, _("Street Address"), text2); |
1087 } else if(!strcmp(child2->name, "LOCALITY")) { | 1087 } else if(!strcmp(child2->name, "LOCALITY")) { |
1088 purple_notify_user_info_add_pair(user_info, _("Locality"), text2); | 1088 purple_notify_user_info_add_pair_plaintext(user_info, _("Locality"), text2); |
1089 } else if(!strcmp(child2->name, "REGION")) { | 1089 } else if(!strcmp(child2->name, "REGION")) { |
1090 purple_notify_user_info_add_pair(user_info, _("Region"), text2); | 1090 purple_notify_user_info_add_pair_plaintext(user_info, _("Region"), text2); |
1091 } else if(!strcmp(child2->name, "PCODE")) { | 1091 } else if(!strcmp(child2->name, "PCODE")) { |
1092 purple_notify_user_info_add_pair(user_info, _("Postal Code"), text2); | 1092 purple_notify_user_info_add_pair_plaintext(user_info, _("Postal Code"), text2); |
1093 } else if(!strcmp(child2->name, "CTRY") | 1093 } else if(!strcmp(child2->name, "CTRY") |
1094 || !strcmp(child2->name, "COUNTRY")) { | 1094 || !strcmp(child2->name, "COUNTRY")) { |
1095 purple_notify_user_info_add_pair(user_info, _("Country"), text2); | 1095 purple_notify_user_info_add_pair_plaintext(user_info, _("Country"), text2); |
1096 } | 1096 } |
1097 g_free(text2); | 1097 g_free(text2); |
1098 } | 1098 } |
1099 | 1099 |
1100 if (address_line_added) | 1100 if (address_line_added) |
1104 char *number; | 1104 char *number; |
1105 if((child2 = xmlnode_get_child(child, "NUMBER"))) { | 1105 if((child2 = xmlnode_get_child(child, "NUMBER"))) { |
1106 /* show what kind of number it is */ | 1106 /* show what kind of number it is */ |
1107 number = xmlnode_get_data(child2); | 1107 number = xmlnode_get_data(child2); |
1108 if(number) { | 1108 if(number) { |
1109 purple_notify_user_info_add_pair(user_info, _("Telephone"), number); | 1109 purple_notify_user_info_add_pair_plaintext(user_info, _("Telephone"), number); |
1110 g_free(number); | 1110 g_free(number); |
1111 } | 1111 } |
1112 } else if((number = xmlnode_get_data(child))) { | 1112 } else if((number = xmlnode_get_data(child))) { |
1113 /* lots of clients (including purple) do this, but it's | 1113 /* lots of clients (including purple) do this, but it's |
1114 * out of spec */ | 1114 * out of spec */ |
1115 purple_notify_user_info_add_pair(user_info, _("Telephone"), number); | 1115 purple_notify_user_info_add_pair_plaintext(user_info, _("Telephone"), number); |
1116 g_free(number); | 1116 g_free(number); |
1117 } | 1117 } |
1118 } else if(!strcmp(child->name, "EMAIL")) { | 1118 } else if(!strcmp(child->name, "EMAIL")) { |
1119 char *userid, *escaped; | 1119 char *userid, *escaped; |
1120 if((child2 = xmlnode_get_child(child, "USERID"))) { | 1120 if((child2 = xmlnode_get_child(child, "USERID"))) { |
1151 if(child2->type != XMLNODE_TYPE_TAG) | 1151 if(child2->type != XMLNODE_TYPE_TAG) |
1152 continue; | 1152 continue; |
1153 | 1153 |
1154 text2 = xmlnode_get_data(child2); | 1154 text2 = xmlnode_get_data(child2); |
1155 if(text2 && !strcmp(child2->name, "ORGNAME")) { | 1155 if(text2 && !strcmp(child2->name, "ORGNAME")) { |
1156 purple_notify_user_info_add_pair(user_info, _("Organization Name"), text2); | 1156 purple_notify_user_info_add_pair_plaintext(user_info, _("Organization Name"), text2); |
1157 } else if(text2 && !strcmp(child2->name, "ORGUNIT")) { | 1157 } else if(text2 && !strcmp(child2->name, "ORGUNIT")) { |
1158 purple_notify_user_info_add_pair(user_info, _("Organization Unit"), text2); | 1158 purple_notify_user_info_add_pair_plaintext(user_info, _("Organization Unit"), text2); |
1159 } | 1159 } |
1160 g_free(text2); | 1160 g_free(text2); |
1161 } | 1161 } |
1162 } else if(text && !strcmp(child->name, "TITLE")) { | 1162 } else if(text && !strcmp(child->name, "TITLE")) { |
1163 purple_notify_user_info_add_pair(user_info, _("Job Title"), text); | 1163 purple_notify_user_info_add_pair_plaintext(user_info, _("Job Title"), text); |
1164 } else if(text && !strcmp(child->name, "ROLE")) { | 1164 } else if(text && !strcmp(child->name, "ROLE")) { |
1165 purple_notify_user_info_add_pair(user_info, _("Role"), text); | 1165 purple_notify_user_info_add_pair_plaintext(user_info, _("Role"), text); |
1166 } else if(text && !strcmp(child->name, "DESC")) { | 1166 } else if(text && !strcmp(child->name, "DESC")) { |
1167 purple_notify_user_info_add_pair(user_info, _("Description"), text); | 1167 purple_notify_user_info_add_pair_plaintext(user_info, _("Description"), text); |
1168 } else if(!strcmp(child->name, "PHOTO") || | 1168 } else if(!strcmp(child->name, "PHOTO") || |
1169 !strcmp(child->name, "LOGO")) { | 1169 !strcmp(child->name, "LOGO")) { |
1170 char *bintext = NULL; | 1170 char *bintext = NULL; |
1171 xmlnode *binval; | 1171 xmlnode *binval; |
1172 | 1172 |