From ba2d90094dbbf611a6d28c9a45f7ed892b162e91 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 30 Aug 2010 14:51:21 +0200 Subject: contact: make some setters static --- libempathy/empathy-contact.c | 202 +++++++++++++++++++++---------------------- 1 file changed, 101 insertions(+), 101 deletions(-) (limited to 'libempathy/empathy-contact.c') diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index ea78476a9..60403145d 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -406,6 +406,107 @@ set_tp_contact (EmpathyContact *contact, G_CALLBACK (tp_contact_notify_cb), contact); } +static 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"); +} + +static void +empathy_contact_set_id (EmpathyContact *contact, + const gchar *id) +{ + EmpathyContactPriv *priv; + + g_return_if_fail (EMPATHY_IS_CONTACT (contact)); + g_return_if_fail (id != NULL); + + priv = GET_PRIV (contact); + + /* We temporally ref the contact because it could be destroyed + * during the signal emition */ + g_object_ref (contact); + if (tp_strdiff (id, priv->id)) + { + g_free (priv->id); + priv->id = g_strdup (id); + + g_object_notify (G_OBJECT (contact), "id"); + if (EMP_STR_EMPTY (priv->alias)) + g_object_notify (G_OBJECT (contact), "alias"); + } + + g_object_unref (contact); +} + +static void +empathy_contact_set_presence (EmpathyContact *contact, + TpConnectionPresenceType presence) +{ + EmpathyContactPriv *priv; + TpConnectionPresenceType old_presence; + + g_return_if_fail (EMPATHY_IS_CONTACT (contact)); + + priv = GET_PRIV (contact); + + if (presence == priv->presence) + return; + + old_presence = priv->presence; + priv->presence = presence; + + g_signal_emit (contact, signals[PRESENCE_CHANGED], 0, presence, old_presence); + + g_object_notify (G_OBJECT (contact), "presence"); +} + +static void +empathy_contact_set_presence_message (EmpathyContact *contact, + const gchar *message) +{ + EmpathyContactPriv *priv = GET_PRIV (contact); + + g_return_if_fail (EMPATHY_IS_CONTACT (contact)); + + if (priv->persona != NULL) + { + folks_presence_set_presence_message (FOLKS_PRESENCE (priv->persona), + message); + } +} + +static void +empathy_contact_set_handle (EmpathyContact *contact, + guint handle) +{ + EmpathyContactPriv *priv; + + g_return_if_fail (EMPATHY_IS_CONTACT (contact)); + + priv = GET_PRIV (contact); + + g_object_ref (contact); + if (handle != priv->handle) + { + priv->handle = handle; + g_object_notify (G_OBJECT (contact), "handle"); + } + g_object_unref (contact); +} + static void contact_get_property (GObject *object, guint param_id, @@ -565,33 +666,6 @@ empathy_contact_get_id (EmpathyContact *contact) return priv->id; } -void -empathy_contact_set_id (EmpathyContact *contact, - const gchar *id) -{ - EmpathyContactPriv *priv; - - g_return_if_fail (EMPATHY_IS_CONTACT (contact)); - g_return_if_fail (id != NULL); - - priv = GET_PRIV (contact); - - /* We temporally ref the contact because it could be destroyed - * during the signal emition */ - g_object_ref (contact); - if (tp_strdiff (id, priv->id)) - { - g_free (priv->id); - priv->id = g_strdup (id); - - g_object_notify (G_OBJECT (contact), "id"); - if (EMP_STR_EMPTY (priv->alias)) - g_object_notify (G_OBJECT (contact), "alias"); - } - - g_object_unref (contact); -} - const gchar * empathy_contact_get_alias (EmpathyContact *contact) { @@ -880,28 +954,6 @@ empathy_contact_get_presence (EmpathyContact *contact) return priv->presence; } -void -empathy_contact_set_presence (EmpathyContact *contact, - TpConnectionPresenceType presence) -{ - EmpathyContactPriv *priv; - TpConnectionPresenceType old_presence; - - g_return_if_fail (EMPATHY_IS_CONTACT (contact)); - - priv = GET_PRIV (contact); - - if (presence == priv->presence) - return; - - old_presence = priv->presence; - priv->presence = presence; - - g_signal_emit (contact, signals[PRESENCE_CHANGED], 0, presence, old_presence); - - g_object_notify (G_OBJECT (contact), "presence"); -} - const gchar * empathy_contact_get_presence_message (EmpathyContact *contact) { @@ -917,21 +969,6 @@ empathy_contact_get_presence_message (EmpathyContact *contact) return NULL; } -void -empathy_contact_set_presence_message (EmpathyContact *contact, - const gchar *message) -{ - EmpathyContactPriv *priv = GET_PRIV (contact); - - g_return_if_fail (EMPATHY_IS_CONTACT (contact)); - - if (priv->persona != NULL) - { - folks_presence_set_presence_message (FOLKS_PRESENCE (priv->persona), - message); - } -} - guint empathy_contact_get_handle (EmpathyContact *contact) { @@ -947,25 +984,6 @@ empathy_contact_get_handle (EmpathyContact *contact) return priv->handle; } -void -empathy_contact_set_handle (EmpathyContact *contact, - guint handle) -{ - EmpathyContactPriv *priv; - - g_return_if_fail (EMPATHY_IS_CONTACT (contact)); - - priv = GET_PRIV (contact); - - g_object_ref (contact); - if (handle != priv->handle) - { - priv->handle = handle; - g_object_notify (G_OBJECT (contact), "handle"); - } - g_object_unref (contact); -} - EmpathyCapabilities empathy_contact_get_capabilities (EmpathyContact *contact) { @@ -978,24 +996,6 @@ empathy_contact_get_capabilities (EmpathyContact *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) { -- cgit v1.2.3