aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/imap
diff options
context:
space:
mode:
authorGravatar silenteh <silenteh@gmail.com>2013-06-04 23:50:41 +0200
committerGravatar silenteh <silenteh@gmail.com>2013-06-04 23:50:41 +0200
commit7caa935cb50e712a1ee99b61d3b0029616773f6d (patch)
tree6c8b09d5e0b6a89b8102679cfa9634ce5e1b4a52 /src/core/imap
parent6fbe6f212003b97860a23c254e5124f0b2578366 (diff)
added the first unread uid from the SELECT imap command - the name of the variable has the wrong name, I will change it on the following commits
Diffstat (limited to 'src/core/imap')
-rw-r--r--src/core/imap/MCIMAPSession.cc13
-rw-r--r--src/core/imap/MCIMAPSession.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/imap/MCIMAPSession.cc b/src/core/imap/MCIMAPSession.cc
index e926be75..542f7e14 100644
--- a/src/core/imap/MCIMAPSession.cc
+++ b/src/core/imap/MCIMAPSession.cc
@@ -329,6 +329,7 @@ void IMAPSession::init()
mUIDNext = 0;
mModSequenceValue = 0;
mFolderMsgCount = 0;
+ mFolderUnseenCount = 0;
mLastFetchedSequenceNumber = 0;
mCurrentFolder = NULL;
pthread_mutex_init(&mIdleLock, NULL);
@@ -840,6 +841,13 @@ void IMAPSession::select(String * folder, ErrorCode * pError)
mFolderMsgCount = -1;
}
+ if (mImap->imap_selection_info->sel_first_unseen) {
+ mFolderUnseenCount = (unsigned int) (mImap->imap_selection_info->sel_first_unseen);
+ } else {
+ mFolderUnseenCount = -1;
+ }
+
+
mModSequenceValue = get_mod_sequence_value(mImap);
}
@@ -2694,6 +2702,11 @@ unsigned int IMAPSession::lastFolderMessageCount()
return mFolderMsgCount;
}
+unsigned int IMAPSession::lastFolderUnseenCount()
+{
+ return mFolderUnseenCount;
+}
+
IMAPSyncResult * IMAPSession::syncMessagesByUID(String * folder, IMAPMessagesRequestKind requestKind,
IndexSet * uids, uint64_t modseq,
IMAPProgressCallback * progressCallback, ErrorCode * pError)
diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h
index 9cf72843..5a052744 100644
--- a/src/core/imap/MCIMAPSession.h
+++ b/src/core/imap/MCIMAPSession.h
@@ -122,6 +122,8 @@ namespace mailcore {
virtual uint32_t uidNext();
virtual uint64_t modSequenceValue();
virtual unsigned int lastFolderMessageCount();
+ virtual unsigned int lastFolderUnseenCount();
+
virtual bool isIdleEnabled();
virtual bool isXListEnabled();
@@ -157,6 +159,8 @@ namespace mailcore {
uint32_t mUIDNext;
uint64_t mModSequenceValue;
unsigned int mFolderMsgCount;
+ unsigned int mFolderUnseenCount;
+
unsigned int mLastFetchedSequenceNumber;
String * mCurrentFolder;
pthread_mutex_t mIdleLock;