empathy r547 - in trunk: . libempathy



Author: xclaesse
Date: Mon Jan 14 12:36:44 2008
New Revision: 547
URL: http://svn.gnome.org/viewvc/empathy?rev=547&view=rev

Log:
Make use of PresenceChanged signal now that it got fixed in MC 4.53. Fixes bug #466960.


Modified:
   trunk/configure.ac
   trunk/libempathy/empathy-idle.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Mon Jan 14 12:36:44 2008
@@ -32,7 +32,7 @@
 LIBPANELAPPLET_REQUIRED=2.10.0
 TELEPATHY_REQUIRED=0.3.1
 TELEPATHY_GLIB_REQUIRED=0.7.0
-MISSION_CONTROL_REQUIRED=4.37
+MISSION_CONTROL_REQUIRED=4.53
 
 # Uncomment that to build without deprecated symbols
 # AC_DEFINE(GTK_DISABLE_DEPRECATED, 1, [Disable deprecated GTK symbols])

Modified: trunk/libempathy/empathy-idle.c
==============================================================================
--- trunk/libempathy/empathy-idle.c	(original)
+++ trunk/libempathy/empathy-idle.c	Mon Jan 14 12:36:44 2008
@@ -83,6 +83,7 @@
 					      GParamSpec       *pspec);
 static void     idle_presence_changed_cb     (MissionControl   *mc,
 					      McPresence        state,
+					      gchar            *status,
 					      EmpathyIdle      *idle);
 static void     idle_session_idle_changed_cb (DBusGProxy       *gs_proxy,
 					      gboolean          is_idle,
@@ -169,10 +170,10 @@
 	priv->is_idle = FALSE;
 	priv->mc = empathy_mission_control_new ();
 	priv->state = mission_control_get_presence_actual (priv->mc, NULL);
-	idle_presence_changed_cb (priv->mc, priv->state, idle);
+	priv->status = mission_control_get_presence_message_actual (priv->mc, NULL);
 
 	dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc),
-				     "PresenceStatusActual",
+				     "PresenceChanged",
 				     G_CALLBACK (idle_presence_changed_cb),
 				     idle, NULL);
 
@@ -489,19 +490,21 @@
 static void
 idle_presence_changed_cb (MissionControl *mc,
 			  McPresence      state,
+			  gchar          *status,
 			  EmpathyIdle    *idle)
 {
 	EmpathyIdlePriv *priv;
 
 	priv = GET_PRIV (idle);
 
+	empathy_debug (DEBUG_DOMAIN, "Presence changed to '%s' (%d)",
+		       status, state);
+
 	g_free (priv->status);
 	priv->state = state;
-	priv->status = mission_control_get_presence_message_actual (priv->mc, NULL);
-
-	if (G_STR_EMPTY (priv->status)) {
-		g_free (priv->status);
-		priv->status = NULL;
+	priv->status = NULL;
+	if (!G_STR_EMPTY (status)) {
+		priv->status = g_strdup (status);
 	}
 
 	g_object_notify (G_OBJECT (idle), "state");



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