aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-05-01 21:57:21 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-01 21:57:21 +0800
commitc495067284d11585b493d9f28667857771498b2a (patch)
tree6b217ea6b93f1c05c5079ec9b340db9e15d44e2c /libempathy
parent8aaf6865026ead0f21a233a2897a89a7de332f5d (diff)
downloadgsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.tar
gsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.tar.gz
gsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.tar.bz2
gsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.tar.lz
gsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.tar.xz
gsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.tar.zst
gsoc2013-empathy-c495067284d11585b493d9f28667857771498b2a.zip
[darcs-to-svn @ Syncing new contact list stuff from gossip]
svn path=/trunk/; revision=15
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/gossip-contact.c18
-rw-r--r--libempathy/gossip-contact.h2
-rw-r--r--libempathy/gossip-utils.c3
3 files changed, 21 insertions, 2 deletions
diff --git a/libempathy/gossip-contact.c b/libempathy/gossip-contact.c
index f19825437..fc0569021 100644
--- a/libempathy/gossip-contact.c
+++ b/libempathy/gossip-contact.c
@@ -610,6 +610,24 @@ gossip_contact_is_online (GossipContact *contact)
return (priv->presence != NULL);
}
+gboolean
+gossip_contact_is_in_group (GossipContact *contact,
+ const gchar *group)
+{
+ GossipContactPriv *priv;
+
+ g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), FALSE);
+ g_return_val_if_fail (!G_STR_EMPTY (group), FALSE);
+
+ priv = GET_PRIV (contact);
+
+ if (g_list_find_custom (priv->groups, group, (GCompareFunc) strcmp)) {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
const gchar *
gossip_contact_get_status (GossipContact *contact)
{
diff --git a/libempathy/gossip-contact.h b/libempathy/gossip-contact.h
index 99f1d2e1e..0b2032949 100644
--- a/libempathy/gossip-contact.h
+++ b/libempathy/gossip-contact.h
@@ -86,6 +86,8 @@ void gossip_contact_set_subscription (GossipContact
void gossip_contact_set_handle (GossipContact *contact,
guint handle);
gboolean gossip_contact_is_online (GossipContact *contact);
+gboolean gossip_contact_is_in_group (GossipContact *contact,
+ const gchar *group);
const gchar * gossip_contact_get_status (GossipContact *contact);
gboolean gossip_contact_equal (gconstpointer v1,
gconstpointer v2);
diff --git a/libempathy/gossip-utils.c b/libempathy/gossip-utils.c
index 430a2f099..3dc4afd48 100644
--- a/libempathy/gossip-utils.c
+++ b/libempathy/gossip-utils.c
@@ -317,8 +317,7 @@ gossip_dbus_type_to_g_type (const gchar *dbus_type_string)
const gchar *
gossip_g_type_to_dbus_type (GType g_type)
{
- switch (g_type)
- {
+ switch (g_type) {
case G_TYPE_STRING:
return "s";
case G_TYPE_BOOLEAN: