Mercurial > pidgin.yaz
changeset 22852:780972e37f0c
merge of '99687ce6fa955d1d32092992b65de140dc944ab0'
and 'd26b1eaa92aaac0a6de151a429c6b7a3bf5bd241'
author | Kevin Stange <kevin@simguy.net> |
---|---|
date | Sat, 10 May 2008 05:20:29 +0000 |
parents | e6674df4cbf1 (diff) d214379806a5 (current diff) |
children | b08b3a01f0d6 |
files | |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/network.c Sat May 10 03:39:51 2008 +0000 +++ b/libpurple/network.c Sat May 10 05:20:29 2008 +0000 @@ -594,17 +594,22 @@ purple_network_is_available(void) { #ifdef HAVE_NETWORKMANAGER_NETWORKMANAGER_H - /* Try NetworkManager first, maybe we'll get lucky */ - if (nm_get_network_state() != NM_STATE_CONNECTED) - { - purple_debug_warning("network", "NetworkManager not active or reports no connection\n"); + NMState state = nm_get_network_state(); + if (state == NM_STATE_UNKNOWN) + { + purple_debug_warning("network", "NetworkManager not active. Assuming connection exists.\n"); + return TRUE; + } + else if (state == NM_STATE_CONNECTED) return TRUE; - } else - return TRUE; + + return FALSE; + #elif defined _WIN32 return (current_network_count > 0); +#else + return TRUE; #endif - return TRUE; } #ifdef HAVE_NETWORKMANAGER_NETWORKMANAGER_H