aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-30 20:51:21 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-01 18:01:36 +0800
commitba2d90094dbbf611a6d28c9a45f7ed892b162e91 (patch)
treee9159f73d55208bea19f0a06f83d6cc03271b526 /libempathy/empathy-contact.c
parent304c189c78f86299c80beb0edbc33d0d970cf458 (diff)
downloadgsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.tar
gsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.tar.gz
gsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.tar.bz2
gsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.tar.lz
gsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.tar.xz
gsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.tar.zst
gsoc2013-empathy-ba2d90094dbbf611a6d28c9a45f7ed892b162e91.zip
contact: make some setters static
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c202
1 files changed, 101 insertions, 101 deletions
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
@@ -407,6 +407,107 @@ set_tp_contact (EmpathyContact *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,
GValue *value,
@@ -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)
{