aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavyd Madeley <davyd@madeley.id.au>2009-04-24 14:47:31 +0800
committerDavyd Madeley <davyd@madeley.id.au>2009-07-15 18:12:15 +0800
commit5b001b1130224ac3400dc8f3432cedf43eaf5d0c (patch)
treec18257b10f5aba89928934446deddfe4ae16e629
parent98d43b78d70e1a2ff6a0b931ad1b8e11790daff0 (diff)
downloadgsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.tar
gsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.tar.gz
gsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.tar.bz2
gsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.tar.lz
gsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.tar.xz
gsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.tar.zst
gsoc2013-empathy-5b001b1130224ac3400dc8f3432cedf43eaf5d0c.zip
Add a FLAGS column to EmpathyContactListStore
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c40
-rw-r--r--libempathy-gtk/empathy-contact-list-store.h1
2 files changed, 28 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 0e9372be1..33cccec01 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -33,6 +33,9 @@
#include <telepathy-glib/util.h>
#include <libempathy/empathy-utils.h>
+#include <libempathy/empathy-enum-types.h>
+#include <libempathy/empathy-contact-manager.h>
+
#include "empathy-contact-list-store.h"
#include "empathy-ui-utils.h"
#include "empathy-gtk-enum-types.h"
@@ -725,19 +728,22 @@ static void
contact_list_store_setup (EmpathyContactListStore *store)
{
EmpathyContactListStorePriv *priv;
- GType types[] = {G_TYPE_STRING, /* Status icon-name */
- GDK_TYPE_PIXBUF, /* Avatar pixbuf */
- G_TYPE_BOOLEAN, /* Avatar pixbuf visible */
- G_TYPE_STRING, /* Name */
- G_TYPE_STRING, /* Status string */
- G_TYPE_BOOLEAN, /* Show status */
- EMPATHY_TYPE_CONTACT, /* Contact type */
- G_TYPE_BOOLEAN, /* Is group */
- G_TYPE_BOOLEAN, /* Is active */
- G_TYPE_BOOLEAN, /* Is online */
- G_TYPE_BOOLEAN, /* Is separator */
- G_TYPE_BOOLEAN, /* Can make audio calls */
- G_TYPE_BOOLEAN}; /* Can make video calls */
+ GType types[] = {
+ G_TYPE_STRING, /* Status icon-name */
+ GDK_TYPE_PIXBUF, /* Avatar pixbuf */
+ G_TYPE_BOOLEAN, /* Avatar pixbuf visible */
+ G_TYPE_STRING, /* Name */
+ G_TYPE_STRING, /* Status string */
+ G_TYPE_BOOLEAN, /* Show status */
+ EMPATHY_TYPE_CONTACT, /* Contact type */
+ G_TYPE_BOOLEAN, /* Is group */
+ G_TYPE_BOOLEAN, /* Is active */
+ G_TYPE_BOOLEAN, /* Is online */
+ G_TYPE_BOOLEAN, /* Is separator */
+ G_TYPE_BOOLEAN, /* Can make audio calls */
+ G_TYPE_BOOLEAN, /* Can make video calls */
+ EMPATHY_TYPE_CONTACT_LIST_FLAGS, /* Flags */
+ };
priv = GET_PRIV (store);
@@ -851,6 +857,8 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
EmpathyContactListStorePriv *priv;
GtkTreeIter iter;
GList *groups = NULL, *l;
+ TpConnection *connection;
+ EmpathyContactListFlags flags;
priv = GET_PRIV (store);
@@ -863,6 +871,10 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
groups = empathy_contact_list_get_groups (priv->list, contact);
}
+ connection = empathy_contact_get_connection (contact);
+ flags = empathy_contact_manager_get_flags_for_connection (
+ EMPATHY_CONTACT_MANAGER (priv->list), connection);
+
/* If no groups just add it at the top level. */
if (!groups) {
gtk_tree_store_append (GTK_TREE_STORE (store), &iter, NULL);
@@ -877,6 +889,7 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
empathy_contact_get_capabilities (contact) &
EMPATHY_CAPABILITIES_VIDEO,
+ EMPATHY_CONTACT_LIST_STORE_COL_FLAGS, flags,
-1);
}
@@ -899,6 +912,7 @@ contact_list_store_add_contact (EmpathyContactListStore *store,
EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
empathy_contact_get_capabilities (contact) &
EMPATHY_CAPABILITIES_VIDEO,
+ EMPATHY_CONTACT_LIST_STORE_COL_FLAGS, flags,
-1);
g_free (l->data);
}
diff --git a/libempathy-gtk/empathy-contact-list-store.h b/libempathy-gtk/empathy-contact-list-store.h
index 007a6b069..f97853991 100644
--- a/libempathy-gtk/empathy-contact-list-store.h
+++ b/libempathy-gtk/empathy-contact-list-store.h
@@ -62,6 +62,7 @@ typedef enum {
EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR,
EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL,
EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL,
+ EMPATHY_CONTACT_LIST_STORE_COL_FLAGS,
EMPATHY_CONTACT_LIST_STORE_COL_COUNT
} EmpathyContactListStoreCol;