aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
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: