Mercurial > pidgin
changeset 22881:b08b3a01f0d6
merge of '0eccb8cefd5975eeab1d14984f2f0114ce7abb79'
and 'e5bed926001291c25b29f85a8ab39b8297a215da'
author | Kevin Stange <kevin@simguy.net> |
---|---|
date | Sat, 10 May 2008 05:21:21 +0000 |
parents | 780972e37f0c (diff) cc1020f9c67e (current diff) |
children | 6421d275c85e |
files | |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/network.c Sat May 10 05:21:09 2008 +0000 +++ b/libpurple/network.c Sat May 10 05:21:21 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