pidgin: 006a7eef: Pop up the buddylist of the running inst...

sadrul at pidgin.im sadrul at pidgin.im
Fri Apr 25 12:30:50 EDT 2008


-----------------------------------------------------------------
Revision: 006a7eef54129319c82b282c765b3fbba968006f
Ancestor: 4f44b915ab4b757df743c26147c1a5242ed033ec
Author: sadrul at pidgin.im
Date: 2008-04-25T16:23:35
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/006a7eef54129319c82b282c765b3fbba968006f

Modified files:
        libpurple/dbus-server.h pidgin/gtkmain.c

ChangeLog: 

Pop up the buddylist of the running instance instead of exiting quietly
when started a second time. References #3417.

-------------- next part --------------
============================================================
--- libpurple/dbus-server.h	ec6d5606aa6b24692d35544cc56aa7966ab8089c
+++ libpurple/dbus-server.h	872ffe150db179a4e4038a8397b8ab5a47e46899
@@ -28,9 +28,9 @@
 #ifndef _PURPLE_DBUS_SERVER_H_
 #define _PURPLE_DBUS_SERVER_H_
 
+#include "dbus-purple.h"
 #include "value.h"
 
-
 G_BEGIN_DECLS
 
 /**
@@ -51,6 +51,8 @@ struct _PurpleDBusType {
     PurpleDBusType *parent;
 };
 
+#include "dbus-bindings.h"
+
 /* By convention, the PurpleDBusType variable representing each structure
    PurpleSomeStructure has the name PURPLE_DBUS_TYPE_PurpleSomeStructure.
    The following macros facilitate defining such variables
============================================================
--- pidgin/gtkmain.c	20b001775dcf3799de6acdf9c8a91cfcb792f71e
+++ pidgin/gtkmain.c	22318a75c7b1e17c983d816ad1fb6b1ede6731f0
@@ -27,6 +27,7 @@
 #include "account.h"
 #include "conversation.h"
 #include "core.h"
+#include "dbus-server.h"
 #include "debug.h"
 #include "eventloop.h"
 #include "ft.h"
@@ -783,6 +784,15 @@ int main(int argc, char *argv[])
 	}
 
 	if (opt_si && !purple_core_ensure_single_instance()) {
+#ifdef HAVE_DBUS
+		DBusConnection *conn = purple_dbus_get_connection();
+		DBusMessage *message = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE,
+				DBUS_INTERFACE_PURPLE, "PurpleBlistSetVisible");
+		gboolean tr = TRUE;
+		dbus_message_append_args(message, DBUS_TYPE_UINT32, &tr, DBUS_TYPE_INVALID);
+		dbus_connection_send_with_reply_and_block(conn, message, -1, NULL);
+		dbus_message_unref(message);
+#endif
 		purple_debug_info("main", "exiting because another libpurple client is already running\n");
 		purple_core_quit();
 #ifdef HAVE_SIGNAL_H


More information about the Commits mailing list