author | alwin <alwin> | 2004-01-03 18:39:24 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-03 18:39:24 (UTC) |
commit | 8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000 (patch) (unidiff) | |
tree | f4f6b9eee00e1b687bfb90bd58949319cf46ec88 /noncore/net/mail/libmailwrapper/imapwrapper.cpp | |
parent | 27b84ed363fd7fc52092e3c2d1e49dca079b7ffd (diff) | |
download | opie-8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000.zip opie-8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000.tar.gz opie-8dd96feb25472a8c4f8e6b3f9b0553f83c6e3000.tar.bz2 |
status methods for mailfolder implemented
Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index b437df0..f1d42c2 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -934,3 +934,43 @@ int IMAPwrapper::deleteMbox(const Folder*folder) | |||
934 | } | 934 | } |
935 | return 1; | 935 | return 1; |
936 | } | 936 | } |
937 | |||
938 | void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | ||
939 | { | ||
940 | mailimap_status_att_list * att_list =0; | ||
941 | mailimap_mailbox_data_status * status=0; | ||
942 | clistiter * cur = 0; | ||
943 | int r = 0; | ||
944 | int res = 0; | ||
945 | target_stat.message_count = 0; | ||
946 | target_stat.message_unseen = 0; | ||
947 | target_stat.message_recent = 0; | ||
948 | login(); | ||
949 | if (!m_imap) { | ||
950 | return; | ||
951 | } | ||
952 | att_list = mailimap_status_att_list_new_empty(); | ||
953 | if (!att_list) return; | ||
954 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_MESSAGES); | ||
955 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_RECENT); | ||
956 | r = mailimap_status_att_list_add(att_list, MAILIMAP_STATUS_ATT_UNSEEN); | ||
957 | r = mailimap_status(m_imap, mailbox.latin1(), att_list, &status); | ||
958 | for (cur = clist_begin(status->st_info_list); | ||
959 | cur != NULL ; cur = clist_next(cur)) { | ||
960 | mailimap_status_info * status_info; | ||
961 | status_info = (mailimap_status_info *)clist_content(cur); | ||
962 | switch (status_info->st_att) { | ||
963 | case MAILIMAP_STATUS_ATT_MESSAGES: | ||
964 | target_stat.message_count = status_info->st_value; | ||
965 | break; | ||
966 | case MAILIMAP_STATUS_ATT_RECENT: | ||
967 | target_stat.message_recent = status_info->st_value; | ||
968 | break; | ||
969 | case MAILIMAP_STATUS_ATT_UNSEEN: | ||
970 | target_stat.message_unseen = status_info->st_value; | ||
971 | break; | ||
972 | } | ||
973 | } | ||
974 | mailimap_mailbox_data_status_free(status); | ||
975 | mailimap_status_att_list_free(att_list); | ||
976 | } | ||