+2012-11-28 [colin] 3.9.0cvs28
+
+ * src/mainwindow.c
+ * src/news.c
+ * src/news.h
+ * src/etpan/nntp-thread.c
+ Disconnect NNTP accounts too when switching offline
+
2012-11-28 [colin] 3.9.0cvs27
* src/imap.c
( cvs diff -u -r 1.115.2.264 -r 1.115.2.265 src/main.c; ) > 3.9.0cvs25.patchset
( cvs diff -u -r 1.179.2.268 -r 1.179.2.269 src/imap.c; cvs diff -u -r 1.1.4.126 -r 1.1.4.127 src/etpan/imap-thread.c; cvs diff -u -r 1.1.4.30 -r 1.1.4.31 src/etpan/imap-thread.h; ) > 3.9.0cvs26.patchset
( cvs diff -u -r 1.179.2.269 -r 1.179.2.270 src/imap.c; cvs diff -u -r 1.101.2.73 -r 1.101.2.74 src/news.c; cvs diff -u -r 1.23.2.28 -r 1.23.2.29 src/common/session.c; cvs diff -u -r 1.8.2.21 -r 1.8.2.22 src/common/session.h; ) > 3.9.0cvs27.patchset
+( cvs diff -u -r 1.274.2.357 -r 1.274.2.358 src/mainwindow.c; cvs diff -u -r 1.101.2.74 -r 1.101.2.75 src/news.c; cvs diff -u -r 1.21.2.11 -r 1.21.2.12 src/news.h; cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/etpan/nntp-thread.c; ) > 3.9.0cvs28.patchset
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=27
+EXTRA_VERSION=28
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
#include "ssl_certificate.h"
#include "socket.h"
#include "remotefolder.h"
+#include "main.h"
+#include "account.h"
#define DISABLE_LOG_DURING_LOGIN
void nntp_main_done(gboolean have_connectivity)
{
+ nntp_disconnect_all(have_connectivity);
etpan_thread_manager_stop(thread_manager);
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
return;
return result.error;
}
+void nntp_main_set_timeout(int sec)
+{
+ mailstream_network_delay.tv_sec = sec;
+ mailstream_network_delay.tv_usec = 0;
+}
#else
#include "tags.h"
#include "textview.h"
#include "imap.h"
+#include "news.h"
#include "socket.h"
#include "printing.h"
#ifdef G_OS_WIN32
mainwindow_check_synchronise(mainwin, TRUE);
prefs_common.work_offline = TRUE;
imap_disconnect_all(have_connectivity);
+ nntp_disconnect_all(have_connectivity);
hooks_invoke(OFFLINE_SWITCH_HOOKLIST, NULL);
} else {
/*go online */
return 0;
}
+void nntp_disconnect_all(gboolean have_connectivity)
+{
+ GList *list;
+ gboolean short_timeout;
+#ifdef HAVE_NETWORKMANAGER_SUPPORT
+ GError *error;
+#endif
+
+#ifdef HAVE_NETWORKMANAGER_SUPPORT
+ error = NULL;
+ short_timeout = !networkmanager_is_online(&error);
+ if(error) {
+ short_timeout = TRUE;
+ g_error_free(error);
+ }
+#else
+ short_timeout = TRUE;
+#endif
+
+ if(short_timeout)
+ nntp_main_set_timeout(1);
+
+ for (list = account_get_list(); list != NULL; list = list->next) {
+ PrefsAccount *account = list->data;
+ if (account->protocol == A_NNTP) {
+ RemoteFolder *folder = (RemoteFolder *)account->folder;
+ if (folder && folder->session) {
+ NewsSession *session = (NewsSession *)folder->session;
+ if (have_connectivity)
+ nntp_threaded_disconnect(FOLDER(folder));
+ SESSION(session)->state = SESSION_DISCONNECTED;
+ SESSION(session)->sock = NULL;
+ session_destroy(SESSION(session));
+ folder->session = NULL;
+ }
+ }
+ }
+
+ if(short_timeout)
+ nntp_main_set_timeout(prefs_common.io_timeout_secs);
+}
+
#else
#include <glib.h>
#include <glib/gi18n.h>
return &news_class;
}
+void nntp_disconnect_all(gboolean have_connectivity)
+{
+}
#endif
guint nntp_folder_get_refcnt(Folder *folder);
void nntp_folder_ref(Folder *folder);
void nntp_folder_unref(Folder *folder);
+void nntp_disconnect_all(gboolean have_connectivity);
#endif /* __NEWS_H__ */