author | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
commit | 6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (unidiff) | |
tree | cb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/libetpan/generic/pop3driver_cached.c | |
parent | b9257cb225cd29bab5d96fcdaf557926603ee587 (diff) | |
download | kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2 |
Mail fixes and libetpan updated
Diffstat (limited to 'kmicromail/libetpan/generic/pop3driver_cached.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libetpan/generic/pop3driver_cached.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/kmicromail/libetpan/generic/pop3driver_cached.c b/kmicromail/libetpan/generic/pop3driver_cached.c index 6f97303..24f624b 100644 --- a/kmicromail/libetpan/generic/pop3driver_cached.c +++ b/kmicromail/libetpan/generic/pop3driver_cached.c | |||
@@ -112,2 +112,5 @@ static int pop3driver_cached_get_message(mailsession * session, | |||
112 | 112 | ||
113 | static int pop3driver_cached_get_message_by_uid(mailsession * session, | ||
114 | const char * uid, mailmessage ** result); | ||
115 | |||
113 | static mailsession_driver local_pop3_cached_session_driver = { | 116 | static mailsession_driver local_pop3_cached_session_driver = { |
@@ -145,2 +148,3 @@ static mailsession_driver local_pop3_cached_session_driver = { | |||
145 | .sess_append_message = NULL, | 148 | .sess_append_message = NULL, |
149 | .sess_append_message_flags = NULL, | ||
146 | .sess_copy_message = NULL, | 150 | .sess_copy_message = NULL, |
@@ -156,3 +160,3 @@ static mailsession_driver local_pop3_cached_session_driver = { | |||
156 | .sess_get_message = pop3driver_cached_get_message, | 160 | .sess_get_message = pop3driver_cached_get_message, |
157 | .sess_get_message_by_uid = NULL, | 161 | .sess_get_message_by_uid = pop3driver_cached_get_message_by_uid, |
158 | }; | 162 | }; |
@@ -857 +861,39 @@ static int pop3driver_cached_get_message(mailsession * session, | |||
857 | } | 861 | } |
862 | |||
863 | static int pop3driver_cached_get_message_by_uid(mailsession * session, | ||
864 | const char * uid, mailmessage ** result) | ||
865 | { | ||
866 | mailpop3 * pop3; | ||
867 | struct mailpop3_msg_info * msg_info; | ||
868 | int found; | ||
869 | unsigned int i; | ||
870 | |||
871 | if (uid == NULL) | ||
872 | return MAIL_ERROR_INVAL; | ||
873 | |||
874 | pop3 = get_pop3_session(session); | ||
875 | |||
876 | found = 0; | ||
877 | |||
878 | /* iterate all messages and look for uid */ | ||
879 | for(i = 0 ; i < carray_count(pop3->pop3_msg_tab) ; i++) { | ||
880 | msg_info = carray_get(pop3->pop3_msg_tab, i); | ||
881 | |||
882 | if (msg_info == NULL) | ||
883 | continue; | ||
884 | |||
885 | if (msg_info->msg_deleted) | ||
886 | continue; | ||
887 | |||
888 | /* uid found, stop looking */ | ||
889 | if (strcmp(msg_info->msg_uidl, uid) == 0) { | ||
890 | found = 1; | ||
891 | break; | ||
892 | } | ||
893 | } | ||
894 | |||
895 | if (!found) | ||
896 | return MAIL_ERROR_MSG_NOT_FOUND; | ||
897 | |||
898 | return pop3driver_cached_get_message(session, msg_info->msg_index, result); | ||
899 | } | ||