+static GdkPixbuf *
+contact_list_store_get_contact_status_icon_with_icon_name (
+ EmpathyContactListStore *store,
+ EmpathyContact *contact,
+ const gchar *status_icon_name)
+{
+ GdkPixbuf *pixbuf_status = NULL;
+ EmpathyContactListStorePriv *priv;
+ const gchar *protocol_name = NULL;
+ gchar *icon_name = NULL;
+
+ priv = GET_PRIV (store);
+
+ if (priv->show_protocols) {
+ protocol_name = empathy_protocol_name_for_contact (contact);
+ icon_name = g_strdup_printf ("%s-%s", status_icon_name, protocol_name);
+ } else {
+ icon_name = g_strdup_printf ("%s", status_icon_name);
+ }
+ pixbuf_status = g_hash_table_lookup (priv->status_icons, icon_name);
+ if (pixbuf_status == NULL) {
+ pixbuf_status = empathy_pixbuf_contact_status_icon_with_icon_name (contact,
+ status_icon_name,
+ priv->show_protocols);
+ if (pixbuf_status != NULL) {
+ g_hash_table_insert (priv->status_icons,
+ g_strdup (icon_name),
+ pixbuf_status);
+ }
+ }
+
+ g_free (icon_name);
+ return pixbuf_status;
+}
+
+GdkPixbuf *
+contact_list_store_get_contact_status_icon (EmpathyContactListStore *store,
+ EmpathyContact *contact)
+{
+ GdkPixbuf *pixbuf_status = NULL;
+ EmpathyContactListStorePriv *priv;
+ const gchar *status_icon_name = NULL;
+ gboolean composing = FALSE;
+
+ priv = GET_PRIV (store);
+
+ if (EMPATHY_IS_TP_CHAT (priv->list)) {
+ if (empathy_tp_chat_get_chat_state (EMPATHY_TP_CHAT (priv->list),
+ contact) ==
+ TP_CHANNEL_CHAT_STATE_COMPOSING)
+ composing = TRUE;
+ }
+
+ if (composing) {
+ status_icon_name = EMPATHY_IMAGE_TYPING;
+ } else {
+ status_icon_name = empathy_icon_name_for_contact (contact);
+ }
+
+ if (status_icon_name == NULL)
+ return NULL;
+
+ pixbuf_status = contact_list_store_get_contact_status_icon_with_icon_name (
+ store,
+ contact,
+ status_icon_name);
+
+ return pixbuf_status;
+}