cpw.gillux.detachablepurple: fad7a505: Fix: check whether a buddy have a name

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sun May 20 13:22:09 EDT 2012


----------------------------------------------------------------------
Revision: fad7a50592f4e344ee6ce2e893437a3ca336f75e
Parent:   13dfb068ec31357f7f41cfa9f7afe038849d14cd
Author:   gillux at soc.pidgin.im
Date:     05/20/12 13:09:19
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/fad7a50592f4e344ee6ce2e893437a3ca336f75e

Changelog: 

Fix: check whether a buddy have a name
before using it in its dbus path name.

Changes against parent 13dfb068ec31357f7f41cfa9f7afe038849d14cd

  patched  libpurple/dbus/buddy.c

-------------- next part --------------
============================================================
--- libpurple/dbus/buddy.c	fdd8c160ab086aa943275b529eaf577716117f1c
+++ libpurple/dbus/buddy.c	9b6d5e65ae2f6661f30f141a92bee34098122677
@@ -26,6 +26,7 @@
 #include "dbus/buddy.xml.h"
 #include "dbus-purple.h"
 #include "dbus-server.h"
+#include "pobject.h"
 
 static char *
 purple_buddy_build_dbus_path(PurpleObject *pobject)
@@ -39,9 +40,13 @@ purple_buddy_build_dbus_path(PurpleObjec
 
 	/* Buddy names arn't unique, so we use an id. We also append the buddy
 	 * name, to make a meaningful path. */
-	name_valid = purple_dbus_sanitize_dbus_path(name);
-	path = g_strdup_printf(DBUS_BUDDY_PATH "/%u_%s", buddy_id++, name_valid);
-	g_free(name_valid);
+	if (name) {
+		name_valid = purple_dbus_sanitize_dbus_path(name);
+		path = g_strdup_printf(DBUS_BUDDY_PATH "/%u_%s", buddy_id++, name_valid);
+		g_free(name_valid);
+	} else {
+		path = g_strdup_printf(DBUS_BUDDY_PATH "/%u", buddy_id++);
+	}
 
 	return path;
 }


More information about the Commits mailing list