soc.2010.detachablepurple: 2de5609e: Exported revelant properties of PurpleCo...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Thu Aug 5 00:04:04 EDT 2010


----------------------------------------------------------------------
Revision: 2de5609ea4502b780a975ed3a7d2bf9ceddfcef0
Parent:   2212e5d97fb82f465aff9f06791ea5536cb9726b
Author:   gillux at soc.pidgin.im
Date:     08/04/10 19:13:55
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/2de5609ea4502b780a975ed3a7d2bf9ceddfcef0

Changelog: 

Exported revelant properties of PurpleConnection.

Changes against parent 2212e5d97fb82f465aff9f06791ea5536cb9726b

  patched  libpurple/connection.c
  patched  libpurple/dbus-prototypes/connection.xml

-------------- next part --------------
============================================================
--- libpurple/connection.c	b3d849f0b4dbe1559156a763c723ea2d8f3e1542
+++ libpurple/connection.c	ce68e922bd43e16b9a991b492e6fba109d7cf153
@@ -183,6 +183,12 @@ _purple_connection_new(PurpleAccount *ac
 
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
 
+	/* We shouldn't get there in remote mode.
+	 * PurpleConnection are only created on the daemon (though exported on
+	 * dbus), from a purple_account_*() function. */
+	if(purple_core_is_remote_mode())
+		g_return_if_reached();
+
 	if (!purple_account_is_disconnected(account))
 		return;
 
@@ -343,6 +349,11 @@ purple_connection_set_state(PurpleConnec
 
 	PurpleConnectionPrivate *priv;
 
+	/* We shouldn't get there in remote mode, connection state should
+	 * only be set by the prpls. */
+	if(purple_core_is_remote_mode())
+		g_return_if_reached();
+
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 	priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
 
@@ -434,6 +445,11 @@ void purple_connection_set_flags(PurpleC
 {
 	PurpleConnectionPrivate *priv;
 
+	/* We shouldn't get there in remote mode, connection flags should
+	 * only be set by the prpls. */
+	if(purple_core_is_remote_mode())
+		g_return_if_reached();
+
 	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
 	priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
 	priv->flags = flags;
@@ -443,8 +459,13 @@ purple_connection_set_account(PurpleConn
 purple_connection_set_account(PurpleConnection *gc, PurpleAccount *account)
 {
 	PurpleConnectionPrivate *priv;
-	g_return_if_fail(account != NULL);
 
+	/* We shouldn't get there in remote mode, the account should
+	 * only be set on the daemon. */
+	if(purple_core_is_remote_mode())
+		g_return_if_reached();
+
+	g_return_if_fail(account != NULL);
 	priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
 
 	if (priv->account == account)
============================================================
--- libpurple/dbus-prototypes/connection.xml	332b8ba37658a54add9d8ca5ea79b6857254d48b
+++ libpurple/dbus-prototypes/connection.xml	bb9f0b247bd0abb095d9ad22cfe09ab8cb499743
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <node name="/im/pidgin/purple/connection">
 	<interface name="im.pidgin.purple.connection">
+		<property type="u" name="flags"   access="read" />
+		<property type="u" name="state"   access="read" />
+		<property type="o" name="account" access="read" />
 	</interface>
 </node>


More information about the Commits mailing list