empathy r1081 - trunk/libempathy



Author: xclaesse
Date: Mon May  5 10:21:17 2008
New Revision: 1081
URL: http://svn.gnome.org/viewvc/empathy?rev=1081&view=rev

Log:
If self presence message is "" do like if it was NULL.


Modified:
   trunk/libempathy/empathy-idle.c
   trunk/libempathy/empathy-tp-contact-factory.c

Modified: trunk/libempathy/empathy-idle.c
==============================================================================
--- trunk/libempathy/empathy-idle.c	(original)
+++ trunk/libempathy/empathy-idle.c	Mon May  5 10:21:17 2008
@@ -172,6 +172,10 @@
 	priv->mc = empathy_mission_control_new ();
 	priv->state = mission_control_get_presence_actual (priv->mc, NULL);
 	priv->status = mission_control_get_presence_message_actual (priv->mc, NULL);
+	if (G_STR_EMPTY (priv->status)) {
+		g_free (priv->status);
+		priv->status = NULL;
+	}
 
 	dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc),
 				     "PresenceChanged",

Modified: trunk/libempathy/empathy-tp-contact-factory.c
==============================================================================
--- trunk/libempathy/empathy-tp-contact-factory.c	(original)
+++ trunk/libempathy/empathy-tp-contact-factory.c	Mon May  5 10:21:17 2008
@@ -107,14 +107,18 @@
 					    EmpathyContact *contact)
 {
 	const GValue *message;
+	const gchar  *message_str = NULL;
 
 	empathy_contact_set_presence (contact,
 				      empathy_presence_from_str (state_str));
 	
 	message = g_hash_table_lookup (presences_table, "message");
-	if (message != NULL) {
-		empathy_contact_set_presence_message (contact,
-						      g_value_get_string (message));
+	if (message) {
+		message_str = g_value_get_string (message);
+	}
+
+	if (!G_STR_EMPTY (message_str)) {
+		empathy_contact_set_presence_message (contact, message_str);
 	} else {
 		empathy_contact_set_presence_message (contact, NULL);
 	}
@@ -139,7 +143,7 @@
 			      (GHFunc) tp_contact_factory_presences_table_foreach,
 			      contact);
 
-	DEBUG ("Changing presence for contact %s (%d) to %s (%d)",
+	DEBUG ("Changing presence for contact %s (%d) to '%s' (%d)",
 		empathy_contact_get_id (contact),
 		handle,
 		empathy_contact_get_presence_message (contact),



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