libgaim/protocols/jabber/jabber.c

changeset 15205
f642029b2f97
parent 15198
08deb9b51708
child 15225
d04a059065dd
equal deleted inserted replaced
15204:6775ac53169c 15205:f642029b2f97
1125 } 1125 }
1126 1126
1127 return ret; 1127 return ret;
1128 } 1128 }
1129 1129
1130 static void jabber_tooltip_text(GaimBuddy *b, GString *str, gboolean full) 1130 static void jabber_tooltip_text(GaimBuddy *b, GaimNotifyUserInfo *user_info, gboolean full)
1131 { 1131 {
1132 JabberBuddy *jb; 1132 JabberBuddy *jb;
1133 1133
1134 g_return_if_fail(b != NULL); 1134 g_return_if_fail(b != NULL);
1135 g_return_if_fail(b->account != NULL); 1135 g_return_if_fail(b->account != NULL);
1158 else if(jb->subscription & JABBER_SUB_PENDING) 1158 else if(jb->subscription & JABBER_SUB_PENDING)
1159 sub = _("None (To pending)"); 1159 sub = _("None (To pending)");
1160 else 1160 else
1161 sub = _("None"); 1161 sub = _("None");
1162 } 1162 }
1163 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Subscription"), sub); 1163
1164 gaim_notify_user_info_add_pair(user_info, _("Subscription"), sub);
1164 } 1165 }
1165 1166
1166 for(l=jb->resources; l; l = l->next) { 1167 for(l=jb->resources; l; l = l->next) {
1167 char *text = NULL; 1168 char *text = NULL;
1168 char *res = NULL; 1169 char *res = NULL;
1170 char *label, *value;
1169 const char *state; 1171 const char *state;
1170 1172
1171 jbr = l->data; 1173 jbr = l->data;
1172 1174
1173 if(jbr->status) { 1175 if(jbr->status) {
1186 if (text != NULL && !gaim_utf8_strcasecmp(state, text)) { 1188 if (text != NULL && !gaim_utf8_strcasecmp(state, text)) {
1187 g_free(text); 1189 g_free(text);
1188 text = NULL; 1190 text = NULL;
1189 } 1191 }
1190 1192
1191 g_string_append_printf(str, "\n<b>%s%s:</b> %s%s%s", 1193 label = g_strdup_printf("%s%s",
1192 _("Status"), 1194 _("Status"), (res ? res : ""));
1193 res ? res : "", 1195 value = g_strdup_printf("%s%s%s",
1194 state, 1196 state,
1195 text ? ": " : "", 1197 (text ? ": " : ""),
1196 text ? text : ""); 1198 (text ? text : ""));
1197 1199
1200 gaim_notify_user_info_add_pair(user_info, label, value);
1201
1202 g_free(label);
1203 g_free(value);
1198 g_free(text); 1204 g_free(text);
1199 g_free(res); 1205 g_free(res);
1200 } 1206 }
1201 1207
1202 if(!GAIM_BUDDY_IS_ONLINE(b) && jb->error_msg) { 1208 if(!GAIM_BUDDY_IS_ONLINE(b) && jb->error_msg) {
1203 g_string_append_printf(str, "\n<b>%s:</b> %s", 1209 gaim_notify_user_info_add_pair(user_info, _("Error"), jb->error_msg);
1204 _("Error"), jb->error_msg);
1205 } 1210 }
1206 } 1211 }
1207 } 1212 }
1208 1213
1209 static GList *jabber_status_types(GaimAccount *account) 1214 static GList *jabber_status_types(GaimAccount *account)

mercurial