comparison libpurple/network.c @ 31454:f5a18dd894cc

Support new connection states in NetworkMakanter 0.9. Fixes #13505. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author dcbw@redhat.com
date Fri, 08 Apr 2011 00:49:24 +0000
parents a8cc50c2279f
children b671728e6ee9
comparison
equal deleted inserted replaced
31453:87825f9602e8 31454:f5a18dd894cc
69 69
70 #ifdef HAVE_NETWORKMANAGER 70 #ifdef HAVE_NETWORKMANAGER
71 #include <dbus/dbus-glib.h> 71 #include <dbus/dbus-glib.h>
72 #include <NetworkManager.h> 72 #include <NetworkManager.h>
73 73
74 #if !defined(NM_CHECK_VERSION)
75 #define NM_CHECK_VERSION(x,y,z) 0
76 #endif
77
74 static DBusGConnection *nm_conn = NULL; 78 static DBusGConnection *nm_conn = NULL;
75 static DBusGProxy *nm_proxy = NULL; 79 static DBusGProxy *nm_proxy = NULL;
76 static DBusGProxy *dbus_proxy = NULL; 80 static DBusGProxy *dbus_proxy = NULL;
77 static NMState nm_state = NM_STATE_UNKNOWN; 81 static NMState nm_state = NM_STATE_UNKNOWN;
78 static gboolean have_nm_state = FALSE; 82 static gboolean have_nm_state = FALSE;
861 865
862 purple_signal_emit(purple_network_get_handle(), "network-configuration-changed", NULL); 866 purple_signal_emit(purple_network_get_handle(), "network-configuration-changed", NULL);
863 867
864 switch(state) 868 switch(state)
865 { 869 {
870 #if NM_CHECK_VERSION(0,8,992)
871 case NM_STATE_CONNECTED_LOCAL:
872 case NM_STATE_CONNECTED_SITE:
873 case NM_STATE_CONNECTED_GLOBAL:
874 #else
866 case NM_STATE_CONNECTED: 875 case NM_STATE_CONNECTED:
876 #endif
867 /* Call res_init in case DNS servers have changed */ 877 /* Call res_init in case DNS servers have changed */
868 res_init(); 878 res_init();
869 /* update STUN IP in case we it changed (theoretically we could 879 /* update STUN IP in case we it changed (theoretically we could
870 have gone from IPv4 to IPv6, f.ex. or we were previously 880 have gone from IPv4 to IPv6, f.ex. or we were previously
871 offline */ 881 offline */
878 ui_ops->network_connected(); 888 ui_ops->network_connected();
879 break; 889 break;
880 case NM_STATE_ASLEEP: 890 case NM_STATE_ASLEEP:
881 case NM_STATE_CONNECTING: 891 case NM_STATE_CONNECTING:
882 case NM_STATE_DISCONNECTED: 892 case NM_STATE_DISCONNECTED:
893 #if NM_CHECK_VERSION(0,8,992)
894 case NM_STATE_DISCONNECTING:
895 #endif
883 if (prev != NM_STATE_CONNECTED && prev != NM_STATE_UNKNOWN) 896 if (prev != NM_STATE_CONNECTED && prev != NM_STATE_UNKNOWN)
884 break; 897 break;
885 if (ui_ops != NULL && ui_ops->network_disconnected != NULL) 898 if (ui_ops != NULL && ui_ops->network_disconnected != NULL)
886 ui_ops->network_disconnected(); 899 ui_ops->network_disconnected();
887 break; 900 break;