aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-09-09 03:15:34 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-09-09 03:15:34 +0800
commitd3e46f8c3570d2486eeab6255899daaaf308b036 (patch)
treebac0e9570e62a84efa9dbc317976f5a8fadb63b2 /libempathy/empathy-contact.c
parentc84cf8d5e36241d2ccb48589496f4d54752a5c54 (diff)
downloadgsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.tar
gsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.tar.gz
gsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.tar.bz2
gsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.tar.lz
gsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.tar.xz
gsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.tar.zst
gsoc2013-empathy-d3e46f8c3570d2486eeab6255899daaaf308b036.zip
Adding capabilities contact property.
2007-09-08 Xavier Claessens <xclaesse@gmail.com> * libempathy/empathy-contact.c: * libempathy/empathy-contact.h: * libempathy/empathy-contact-factory.c: Adding capabilities contact property. svn path=/trunk/; revision=291
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 505e190c0..221b06e17 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -47,6 +47,7 @@ struct _EmpathyContactPriv {
McAccount *account;
EmpathyPresence *presence;
guint handle;
+ EmpathyCapabilities capabilities;
gboolean is_user;
};
@@ -74,6 +75,7 @@ enum {
PROP_GROUPS,
PROP_SUBSCRIPTION,
PROP_HANDLE,
+ PROP_CAPABILITIES,
PROP_IS_USER
};
@@ -137,6 +139,16 @@ empathy_contact_class_init (EmpathyContactClass *class)
G_MAXUINT,
0,
G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class,
+ PROP_CAPABILITIES,
+ g_param_spec_flags ("capabilities",
+ "Contact Capabilities",
+ "Capabilities of the contact",
+ EMPATHY_TYPE_CAPABILITIES,
+ 0,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (object_class,
PROP_IS_USER,
g_param_spec_boolean ("is-user",
@@ -211,6 +223,9 @@ contact_get_property (GObject *object,
case PROP_HANDLE:
g_value_set_uint (value, priv->handle);
break;
+ case PROP_CAPABILITIES:
+ g_value_set_flags (value, priv->capabilities);
+ break;
case PROP_IS_USER:
g_value_set_boolean (value, priv->is_user);
break;
@@ -255,6 +270,10 @@ contact_set_property (GObject *object,
empathy_contact_set_handle (EMPATHY_CONTACT (object),
g_value_get_uint (value));
break;
+ case PROP_CAPABILITIES:
+ empathy_contact_set_capabilities (EMPATHY_CONTACT (object),
+ g_value_get_flags (value));
+ break;
case PROP_IS_USER:
empathy_contact_set_is_user (EMPATHY_CONTACT (object),
g_value_get_boolean (value));
@@ -501,6 +520,37 @@ empathy_contact_set_handle (EmpathyContact *contact,
g_object_notify (G_OBJECT (contact), "handle");
}
+EmpathyCapabilities
+empathy_contact_get_capabilities (EmpathyContact *contact)
+{
+ EmpathyContactPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), 0);
+
+ priv = GET_PRIV (contact);
+
+ return priv->capabilities;
+}
+
+void
+empathy_contact_set_capabilities (EmpathyContact *contact,
+ EmpathyCapabilities capabilities)
+{
+ EmpathyContactPriv *priv;
+
+ g_return_if_fail (EMPATHY_IS_CONTACT (contact));
+
+ priv = GET_PRIV (contact);
+
+ if (priv->capabilities == capabilities) {
+ return;
+ }
+
+ priv->capabilities = capabilities;
+
+ g_object_notify (G_OBJECT (contact), "capabilities");
+}
+
gboolean
empathy_contact_is_user (EmpathyContact *contact)
{