diff libpurple/dbus-server.c @ 17708:9f5c9df30287

D-Bus unique stuff. Had to add a few NULL-checks here and there, because some things were assumed to not be NULL.
author Gabriel Schulhof <nix@go-nix.ca>
date Sun, 13 May 2007 19:52:05 +0000
parents 3130a2cfe4e0
children 176d0fc8bc16
line wrap: on
line diff
--- a/libpurple/dbus-server.c	Sun May 13 10:26:08 2007 +0000
+++ b/libpurple/dbus-server.c	Sun May 13 19:52:05 2007 +0000
@@ -604,6 +604,25 @@
 		return;
 	}
 
+	if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
+		DBusMessage *msg = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE, DBUS_INTERFACE_PURPLE, "PurpleBlistShow") ;
+
+		if (NULL != msg) {
+			DBusMessage *reply = NULL ;
+			DBusError dbus_error ;
+
+			dbus_error_init(&dbus_error) ;
+			reply = dbus_connection_send_with_reply_and_block(purple_dbus_connection, msg, 5000, &dbus_error) ;
+			dbus_message_unref(msg) ;
+			if (NULL != reply)
+				dbus_message_unref(reply) ;
+			dbus_error_free(&dbus_error) ;
+		}
+
+		purple_core_quit() ;
+		_exit(0) ;
+	}
+
 	dbus_connection_setup_with_g_main(purple_dbus_connection, NULL);
 
 	purple_debug_misc("dbus", "okkk\n");