aboutsummaryrefslogtreecommitdiff
path: root/libsylph/imap.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-05-18 04:58:23 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-05-18 04:58:23 +0000
commit192f216fca62585bbd810655792a25393d612b06 (patch)
tree1c464ae4407321a5b22d8739ecc5276685b9d4bf /libsylph/imap.c
parentdc556e29120702f70ebea1f8d3237a26527b04e2 (diff)
cancel online mode switch if active sessions exist.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2881 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.c')
-rw-r--r--libsylph/imap.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libsylph/imap.c b/libsylph/imap.c
index 53d37b58..5414d0ac 100644
--- a/libsylph/imap.c
+++ b/libsylph/imap.c
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2010 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -5112,3 +5112,20 @@ static gint imap_thread_run_progress(IMAPSession *session, IMAPThreadFunc func,
return ret;
}
#endif /* USE_THREADS */
+
+gboolean imap_is_session_active(IMAPFolder *folder)
+{
+#if USE_THREADS
+ IMAPRealSession *real;
+
+ g_return_val_if_fail(folder != NULL, FALSE);
+
+ real = (IMAPRealSession *)(REMOTE_FOLDER(folder)->session);
+ if (!real)
+ return FALSE;
+
+ return real->is_running;
+#else
+ return FALSE;
+#endif
+}