[empathy/gnome-2-34] Adjust for FolksHasPresence -> FolksPresenceOwner



commit 2ef91742f4fedf3dfb398021619ac437dd4f3def
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Wed Dec 22 17:22:59 2010 -0800

    Adjust for FolksHasPresence -> FolksPresenceOwner
    
    Fixes bgo#637847.

 libempathy-gtk/empathy-individual-store.c  |   17 ++++++++++++-----
 libempathy-gtk/empathy-individual-view.c   |    2 +-
 libempathy-gtk/empathy-individual-widget.c |    9 ++++++---
 libempathy-gtk/empathy-persona-store.c     |   16 +++++++++-------
 libempathy-gtk/empathy-ui-utils.c          |    4 +++-
 libempathy/empathy-contact.c               |   20 ++++++++++++--------
 6 files changed, 43 insertions(+), 25 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 6ab52e8..4146407 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -673,7 +673,8 @@ individual_store_contact_update (EmpathyIndividualStore *self,
     }
 
   /* Get online state now. */
-  now_online = folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual));
+  now_online = folks_presence_owner_is_online (
+      FOLKS_PRESENCE_OWNER (individual));
 
   if (!in_list)
     {
@@ -760,9 +761,11 @@ individual_store_contact_update (EmpathyIndividualStore *self,
           EMPATHY_INDIVIDUAL_STORE_COL_NAME,
             folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)),
           EMPATHY_INDIVIDUAL_STORE_COL_PRESENCE_TYPE,
-            folks_individual_get_presence_type (individual),
+            folks_presence_owner_get_presence_type (
+                FOLKS_PRESENCE_OWNER (individual)),
           EMPATHY_INDIVIDUAL_STORE_COL_STATUS,
-            folks_individual_get_presence_message (individual),
+            folks_presence_owner_get_presence_message (
+                FOLKS_PRESENCE_OWNER (individual)),
           EMPATHY_INDIVIDUAL_STORE_COL_COMPACT, priv->is_compact,
           EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, FALSE,
           EMPATHY_INDIVIDUAL_STORE_COL_IS_ONLINE, now_online,
@@ -1422,8 +1425,12 @@ individual_store_state_sort_func (GtkTreeModel *model,
   /* If we managed to get this far, we can start looking at
    * the presences.
    */
-  folks_presence_type_a = folks_individual_get_presence_type (individual_a);
-  folks_presence_type_b = folks_individual_get_presence_type (individual_b);
+  folks_presence_type_a =
+      folks_presence_owner_get_presence_type (
+          FOLKS_PRESENCE_OWNER (individual_a));
+  folks_presence_type_b =
+      folks_presence_owner_get_presence_type (
+          FOLKS_PRESENCE_OWNER (individual_b));
   tp_presence_a = empathy_folks_presence_type_to_tp (folks_presence_type_a);
   tp_presence_b = empathy_folks_presence_type_to_tp (folks_presence_type_b);
 
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 4c13e78..1eeaa0d 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -624,7 +624,7 @@ individual_view_drag_motion (GtkWidget *widget,
         }
 
       if (individual != NULL &&
-          folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual)) &&
+          folks_presence_owner_is_online (FOLKS_PRESENCE_OWNER (individual)) &&
           (caps & EMPATHY_CAPABILITIES_FT))
         {
           gdk_drag_status (context, GDK_ACTION_COPY, time_);
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 41e4110..dd89464 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -1167,11 +1167,13 @@ notify_presence_cb (gpointer folks_object,
   state_image = g_object_get_data (table, "state-image");
 
   /* FIXME: Default messages should be moved into libfolks (bgo#627403) */
-  message = folks_presence_get_presence_message (FOLKS_PRESENCE (folks_object));
+  message = folks_presence_owner_get_presence_message (
+      FOLKS_PRESENCE_OWNER (folks_object));
   if (EMP_STR_EMPTY (message))
     {
       message = empathy_presence_get_default_message (
-          folks_presence_get_presence_type (FOLKS_PRESENCE (folks_object)));
+          folks_presence_owner_get_presence_type (
+              FOLKS_PRESENCE_OWNER (folks_object)));
     }
 
   if (message != NULL)
@@ -1181,7 +1183,8 @@ notify_presence_cb (gpointer folks_object,
 
   gtk_image_set_from_icon_name (GTK_IMAGE (state_image),
       empathy_icon_name_for_presence (
-          folks_presence_get_presence_type (FOLKS_PRESENCE (folks_object))),
+          folks_presence_owner_get_presence_type (
+              FOLKS_PRESENCE_OWNER (folks_object))),
       GTK_ICON_SIZE_BUTTON);
   gtk_widget_show (state_image);
 }
diff --git a/libempathy-gtk/empathy-persona-store.c b/libempathy-gtk/empathy-persona-store.c
index a09a3e4..c1c8ea9 100644
--- a/libempathy-gtk/empathy-persona-store.c
+++ b/libempathy-gtk/empathy-persona-store.c
@@ -438,7 +438,8 @@ update_persona (EmpathyPersonaStore *self,
       gtk_tree_path_free (path);
 
       /* Get online state now. */
-      now_online = folks_presence_is_online (FOLKS_PRESENCE (persona));
+      now_online = folks_presence_owner_is_online (
+          FOLKS_PRESENCE_OWNER (persona));
 
       /* Get online state before. */
       gtk_tree_model_get (GTK_TREE_MODEL (self), &iter,
@@ -484,11 +485,11 @@ update_persona (EmpathyPersonaStore *self,
           EMPATHY_PERSONA_STORE_COL_DISPLAY_ID,
               folks_persona_get_display_id (persona),
           EMPATHY_PERSONA_STORE_COL_PRESENCE_TYPE,
-              folks_has_presence_get_presence_type (
-                  FOLKS_HAS_PRESENCE (persona)),
+              folks_presence_owner_get_presence_type (
+                  FOLKS_PRESENCE_OWNER (persona)),
           EMPATHY_PERSONA_STORE_COL_STATUS,
-              folks_has_presence_get_presence_message (
-                  FOLKS_HAS_PRESENCE (persona)),
+              folks_presence_owner_get_presence_message (
+                  FOLKS_PRESENCE_OWNER (persona)),
           EMPATHY_PERSONA_STORE_COL_IS_ONLINE, now_online,
           EMPATHY_PERSONA_STORE_COL_CAN_AUDIO_CALL,
               empathy_contact_get_capabilities (contact) &
@@ -621,8 +622,9 @@ state_sort_func (GtkTreeModel *model,
    * the presences.
    */
   ret_val = -tp_connection_presence_type_cmp_availability (
-      folks_presence_get_presence_type (FOLKS_PRESENCE (persona_a)),
-      folks_presence_get_presence_type (FOLKS_PRESENCE (persona_b)));
+      folks_presence_owner_get_presence_type (FOLKS_PRESENCE_OWNER (persona_a)),
+      folks_presence_owner_get_presence_type (
+          FOLKS_PRESENCE_OWNER (persona_b)));
 
   if (ret_val == 0) {
     /* Fallback: compare by name et al. */
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 64d3df1..ad4c950 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -231,7 +231,9 @@ empathy_icon_name_for_individual (FolksIndividual *individual)
 	FolksPresenceType folks_presence;
 	TpConnectionPresenceType presence;
 
-	folks_presence = folks_individual_get_presence_type (individual);
+	folks_presence =
+	    folks_presence_owner_get_presence_type (
+	        FOLKS_PRESENCE_OWNER (individual));
 	presence = empathy_folks_presence_type_to_tp (folks_presence);
 
 	return empathy_icon_name_for_presence (presence);
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index e7b5bd5..f91b587 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -484,8 +484,8 @@ empathy_contact_set_presence_message (EmpathyContact *contact,
 
   if (priv->persona != NULL)
     {
-      folks_presence_set_presence_message (FOLKS_PRESENCE (priv->persona),
-          message);
+      folks_presence_owner_set_presence_message (
+          FOLKS_PRESENCE_OWNER (priv->persona), message);
     }
 }
 
@@ -965,7 +965,10 @@ empathy_contact_get_presence_message (EmpathyContact *contact)
   priv = GET_PRIV (contact);
 
   if (priv->persona != NULL)
-    return folks_presence_get_presence_message (FOLKS_PRESENCE (priv->persona));
+    {
+      return folks_presence_owner_get_presence_message (
+          FOLKS_PRESENCE_OWNER (priv->persona));
+    }
 
   if (priv->tp_contact != NULL)
     return tp_contact_get_presence_message (priv->tp_contact);
@@ -1743,15 +1746,16 @@ static int
 presence_cmp_func (EmpathyContact *a,
     EmpathyContact *b)
 {
-  FolksPresence *presence_a, *presence_b;
+  FolksPresenceOwner *presence_a, *presence_b;
 
-  presence_a = FOLKS_PRESENCE (empathy_contact_get_persona (a));
-  presence_b = FOLKS_PRESENCE (empathy_contact_get_persona (b));
+  presence_a = FOLKS_PRESENCE_OWNER (empathy_contact_get_persona (a));
+  presence_b = FOLKS_PRESENCE_OWNER (empathy_contact_get_persona (b));
 
   /* We negate the result because we're sorting in reverse order (i.e. such that
    * the Personas with the highest presence are at the beginning of the list. */
-  return -folks_presence_typecmp (folks_presence_get_presence_type (presence_a),
-      folks_presence_get_presence_type (presence_b));
+  return -folks_presence_owner_typecmp (
+      folks_presence_owner_get_presence_type (presence_a),
+      folks_presence_owner_get_presence_type (presence_b));
 }
 
 static gint



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]