aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/gossip-contact.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-06-09 03:22:39 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-06-09 03:22:39 +0800
commitdb7cecd7653d88081ea9c89ac7e68b0816961189 (patch)
treebfa907fe6da0e13001c0ec3c8617506e3e5d7e92 /libempathy/gossip-contact.c
parentd8b89b20f13552d3bd1c658f3396714e24744ff6 (diff)
downloadgsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.tar
gsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.tar.gz
gsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.tar.bz2
gsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.tar.lz
gsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.tar.xz
gsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.tar.zst
gsoc2013-empathy-db7cecd7653d88081ea9c89ac7e68b0816961189.zip
Do not save when closing the dialog. Update information in real-time and
2007-06-08 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-contact-dialogs.c: * libempathy-gtk/empathy-contact-widget.c: * libempathy-gtk/empathy-contact-widget.h: Do not save when closing the dialog. Update information in real-time and just provides a "Close" button. That's more GNOME spirite. * libempathy/empathy-tp-contact-list.c: * libempathy/gossip-contact.h: * libempathy/gossip-contact.c: New methods: gossip_contact_add/remove_group(). This fixes leaks when a contact is added/removed from a group. svn path=/trunk/; revision=132
Diffstat (limited to 'libempathy/gossip-contact.c')
-rw-r--r--libempathy/gossip-contact.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/libempathy/gossip-contact.c b/libempathy/gossip-contact.c
index 267d86646..86b6ee6e0 100644
--- a/libempathy/gossip-contact.c
+++ b/libempathy/gossip-contact.c
@@ -592,6 +592,8 @@ gossip_contact_set_handle (GossipContact *contact,
{
GossipContactPriv *priv;
+ g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+
priv = GET_PRIV (contact);
priv->handle = handle;
@@ -599,6 +601,43 @@ gossip_contact_set_handle (GossipContact *contact,
g_object_notify (G_OBJECT (contact), "handle");
}
+void
+gossip_contact_add_group (GossipContact *contact,
+ const gchar *group)
+{
+ GossipContactPriv *priv;
+
+ g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+ g_return_if_fail (group != NULL);
+
+ priv = GET_PRIV (contact);
+
+ if (!g_list_find_custom (priv->groups, group, (GCompareFunc) strcmp)) {
+ priv->groups = g_list_prepend (priv->groups, g_strdup (group));
+ g_object_notify (G_OBJECT (contact), "groups");
+ }
+}
+
+void
+gossip_contact_remove_group (GossipContact *contact,
+ const gchar *group)
+{
+ GossipContactPriv *priv;
+ GList *l;
+
+ g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+ g_return_if_fail (group != NULL);
+
+ priv = GET_PRIV (contact);
+
+ l = g_list_find_custom (priv->groups, group, (GCompareFunc) strcmp);
+ if (l) {
+ g_free (l->data);
+ priv->groups = g_list_delete_link (priv->groups, l);
+ g_object_notify (G_OBJECT (contact), "groups");
+ }
+}
+
gboolean
gossip_contact_is_online (GossipContact *contact)
{