| 114 |
114 |
| 115 /* copy-paste from gtkrequest.c */ |
115 /* copy-paste from gtkrequest.c */ |
| 116 static void |
116 static void |
| 117 pidgin_widget_decorate_account(GtkWidget *cont, PurpleAccount *account) |
117 pidgin_widget_decorate_account(GtkWidget *cont, PurpleAccount *account) |
| 118 { |
118 { |
| |
119 PurpleContactInfo *info = NULL; |
| 119 PurpleProtocol *protocol = NULL; |
120 PurpleProtocol *protocol = NULL; |
| 120 GtkWidget *image; |
121 GtkWidget *image; |
| 121 const gchar *icon_name = NULL; |
122 const gchar *icon_name = NULL; |
| 122 |
123 |
| 123 if (!account) |
124 if (!account) |
| 124 return; |
125 return; |
| 125 |
126 |
| |
127 info = PURPLE_CONTACT_INFO(account); |
| 126 protocol = purple_account_get_protocol(account); |
128 protocol = purple_account_get_protocol(account); |
| 127 icon_name = purple_protocol_get_icon_name(protocol); |
129 icon_name = purple_protocol_get_icon_name(protocol); |
| 128 |
130 |
| 129 image = gtk_image_new_from_icon_name(icon_name); |
131 image = gtk_image_new_from_icon_name(icon_name); |
| 130 |
132 |
| 131 gtk_widget_set_tooltip_text(image, |
133 gtk_widget_set_tooltip_text(image, purple_contact_info_get_username(info)); |
| 132 purple_account_get_username(account)); |
|
| 133 |
134 |
| 134 if (GTK_IS_BOX(cont)) { |
135 if (GTK_IS_BOX(cont)) { |
| 135 gtk_widget_set_halign(image, GTK_ALIGN_START); |
136 gtk_widget_set_halign(image, GTK_ALIGN_START); |
| 136 gtk_widget_set_valign(image, GTK_ALIGN_START); |
137 gtk_widget_set_valign(image, GTK_ALIGN_START); |
| 137 gtk_widget_set_hexpand(image, TRUE); |
138 gtk_widget_set_hexpand(image, TRUE); |
| 537 static char * |
538 static char * |
| 538 userinfo_hash(PurpleAccount *account, const char *who) |
539 userinfo_hash(PurpleAccount *account, const char *who) |
| 539 { |
540 { |
| 540 char key[256]; |
541 char key[256]; |
| 541 g_snprintf(key, sizeof(key), "%s - %s", |
542 g_snprintf(key, sizeof(key), "%s - %s", |
| 542 purple_account_get_username(account), |
543 purple_contact_info_get_username(PURPLE_CONTACT_INFO(account)), |
| 543 purple_normalize(account, who)); |
544 purple_normalize(account, who)); |
| 544 return g_utf8_strup(key, -1); |
545 return g_utf8_strup(key, -1); |
| 545 } |
546 } |
| 546 |
547 |
| 547 static void |
548 static void |