pidgin.2.x.y: 5fd6531c: *** Plucked rev 10ead4688e3af4132d454fa3...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Feb 15 04:45:42 EST 2012


----------------------------------------------------------------------
Revision: 5fd6531ce513268ae34115d19ceb07fcf61ffd71
Parent:   55e8711512be87f2d917ee78e0659ca9d27b8377
Author:   markdoliner at pidgin.im
Date:     02/15/12 04:39:56
Branch:   im.pidgin.pidgin.2.x.y
URL: http://d.pidgin.im/viewmtn/revision/info/5fd6531ce513268ae34115d19ceb07fcf61ffd71

Changelog: 

*** Plucked rev 10ead4688e3af4132d454fa3bc241480500651c9 (dcbw at redhat.com):
Support new connection states and signals for NetworkManager 0.9+.

Fixes #13859.

Changes against parent 55e8711512be87f2d917ee78e0659ca9d27b8377

  patched  ChangeLog
  patched  libpurple/network.c

-------------- next part --------------
============================================================
--- ChangeLog	f192aec30ec7447e0b9c252cc84b69b6d026f51f
+++ ChangeLog	d4652b9057512c5f9adf7e9d717307b5c96f9f70
@@ -4,6 +4,10 @@ version 2.10.2 (02/22/2012):
 	General:
 	* Fix compilation when using binutils 2.22 and new GDK pixbuf. (#14799)
 
+	libpurple:
+	* Support new connection states and signals for NetworkManager 0.9+.
+	  (Dan Williams) (#13859)
+
 	AIM and ICQ:
 	* Allow signing on with usernames containing periods and
 	  underscores. (#13500)
============================================================
--- libpurple/network.c	157a020a2d0f90e144a1de465be40848bb51df7c
+++ libpurple/network.c	0fd6b21a03f0022156733fe13aad77962b1964df
@@ -833,8 +833,20 @@ purple_network_is_available(void)
 			purple_debug_warning("network", "NetworkManager not active. Assuming connection exists.\n");
 	}
 
-	if (nm_state == NM_STATE_UNKNOWN || nm_state == NM_STATE_CONNECTED)
-		return TRUE;
+	switch (nm_state)
+	{
+		case NM_STATE_UNKNOWN:
+#if NM_CHECK_VERSION(0,8,992)
+		case NM_STATE_CONNECTED_LOCAL:
+		case NM_STATE_CONNECTED_SITE:
+		case NM_STATE_CONNECTED_GLOBAL:
+#else
+		case NM_STATE_CONNECTED:
+#endif
+			return TRUE;
+		default:
+			break;
+	}
 
 	return FALSE;
 
@@ -1171,9 +1183,14 @@ purple_network_init(void)
 		                                     NM_DBUS_SERVICE,
 		                                     NM_DBUS_PATH,
 		                                     NM_DBUS_INTERFACE);
+		/* NM 0.6 signal */
 		dbus_g_proxy_add_signal(nm_proxy, "StateChange", G_TYPE_UINT, G_TYPE_INVALID);
 		dbus_g_proxy_connect_signal(nm_proxy, "StateChange",
 		                            G_CALLBACK(nm_state_change_cb), NULL, NULL);
+		/* NM 0.7 and later signal */
+		dbus_g_proxy_add_signal(nm_proxy, "StateChanged", G_TYPE_UINT, G_TYPE_INVALID);
+		dbus_g_proxy_connect_signal(nm_proxy, "StateChanged",
+		                            G_CALLBACK(nm_state_change_cb), NULL, NULL);
 
 		dbus_proxy = dbus_g_proxy_new_for_name(nm_conn,
 		                                       DBUS_SERVICE_DBUS,
@@ -1208,6 +1225,7 @@ purple_network_uninit(void)
 #ifdef HAVE_NETWORKMANAGER
 	if (nm_proxy) {
 		dbus_g_proxy_disconnect_signal(nm_proxy, "StateChange", G_CALLBACK(nm_state_change_cb), NULL);
+		dbus_g_proxy_disconnect_signal(nm_proxy, "StateChanged", G_CALLBACK(nm_state_change_cb), NULL);
 		g_object_unref(G_OBJECT(nm_proxy));
 	}
 	if (dbus_proxy) {


More information about the Commits mailing list