summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan/generic/nntpdriver.c
authorzautrix <zautrix>2004-09-01 10:23:29 (UTC)
committer zautrix <zautrix>2004-09-01 10:23:29 (UTC)
commit6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (side-by-side diff)
treecb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/libetpan/generic/nntpdriver.c
parentb9257cb225cd29bab5d96fcdaf557926603ee587 (diff)
downloadkdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip
kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz
kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2
Mail fixes and libetpan updated
Diffstat (limited to 'kmicromail/libetpan/generic/nntpdriver.c') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libetpan/generic/nntpdriver.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kmicromail/libetpan/generic/nntpdriver.c b/kmicromail/libetpan/generic/nntpdriver.c
index fde5f1a..1b65838 100644
--- a/kmicromail/libetpan/generic/nntpdriver.c
+++ b/kmicromail/libetpan/generic/nntpdriver.c
@@ -48,48 +48,51 @@ static int nntpdriver_initialize(mailsession * session);
static void nntpdriver_uninitialize(mailsession * session);
static int nntpdriver_parameters(mailsession * session,
int id, void * value);
static int nntpdriver_connect_stream(mailsession * session, mailstream * s);
static int nntpdriver_login(mailsession * session,
char * userid, char * password);
static int nntpdriver_logout(mailsession * session);
static int nntpdriver_status_folder(mailsession * session, char * mb,
uint32_t * result_messages,
uint32_t * result_recent,
uint32_t * result_unseen);
static int nntpdriver_messages_number(mailsession * session, char * mb,
uint32_t * result);
static int nntpdriver_append_message(mailsession * session,
char * message, size_t size);
+static int nntpdriver_append_message_flags(mailsession * session,
+ char * message, size_t size, struct mail_flags * flags);
+
static int
nntpdriver_get_envelopes_list(mailsession * session,
struct mailmessage_list * env_list);
static int nntpdriver_get_messages_list(mailsession * session,
struct mailmessage_list ** result);
static int nntpdriver_list_folders(mailsession * session, char * mb,
struct mail_list ** result);
static int nntpdriver_lsub_folders(mailsession * session, char * mb,
struct mail_list ** result);
static int nntpdriver_subscribe_folder(mailsession * session, char * mb);
static int nntpdriver_unsubscribe_folder(mailsession * session, char * mb);
static int nntpdriver_get_message(mailsession * session,
uint32_t num, mailmessage ** result);
static int nntpdriver_get_message_by_uid(mailsession * session,
const char * uid,
mailmessage ** result);
@@ -108,48 +111,49 @@ static mailsession_driver local_nntp_session_driver = {
.sess_connect_path = NULL,
.sess_starttls = NULL,
.sess_login = nntpdriver_login,
.sess_logout = nntpdriver_logout,
.sess_noop = nntpdriver_noop,
.sess_build_folder_name = NULL,
.sess_create_folder = NULL,
.sess_delete_folder = NULL,
.sess_rename_folder = NULL,
.sess_check_folder = NULL,
.sess_examine_folder = NULL,
.sess_select_folder = nntpdriver_select_folder,
.sess_expunge_folder = NULL,
.sess_status_folder = nntpdriver_status_folder,
.sess_messages_number = nntpdriver_messages_number,
.sess_recent_number = nntpdriver_messages_number,
.sess_unseen_number = nntpdriver_messages_number,
.sess_list_folders = nntpdriver_list_folders,
.sess_lsub_folders = nntpdriver_lsub_folders,
.sess_subscribe_folder = nntpdriver_subscribe_folder,
.sess_unsubscribe_folder = nntpdriver_unsubscribe_folder,
.sess_append_message = nntpdriver_append_message,
+ .sess_append_message_flags = nntpdriver_append_message_flags,
.sess_copy_message = NULL,
.sess_move_message = NULL,
.sess_get_messages_list = nntpdriver_get_messages_list,
.sess_get_envelopes_list = nntpdriver_get_envelopes_list,
.sess_remove_message = NULL,
#if 0
.sess_search_messages = maildriver_generic_search_messages,
#endif
.sess_get_message = nntpdriver_get_message,
.sess_get_message_by_uid = nntpdriver_get_message_by_uid,
};
mailsession_driver * nntp_session_driver = &local_nntp_session_driver;
static inline struct nntp_session_state_data *
get_data(mailsession * session)
{
return session->sess_data;
}
static inline newsnntp * get_nntp_session(mailsession * session)
@@ -609,48 +613,54 @@ static int nntpdriver_append_message(mailsession * session,
data = get_data(session);
do {
r = newsnntp_post(get_nntp_session(session), message, size);
switch (r) {
case NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_USERNAME:
r = nntpdriver_authenticate_user(session);
if (r != MAIL_NO_ERROR)
return r;
break;
case NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_PASSWORD:
r = nntpdriver_authenticate_password(session);
if (r != MAIL_NO_ERROR)
return r;
break;
default:
return nntpdriver_nntp_error_to_mail_error(r);
}
}
while (1);
}
+static int nntpdriver_append_message_flags(mailsession * session,
+ char * message, size_t size, struct mail_flags * flags)
+{
+ return nntpdriver_append_message(session, message, size);
+}
+
static int xover_resp_to_fields(struct newsnntp_xover_resp_item * item,
struct mailimf_fields ** result);
static int
nntpdriver_get_envelopes_list(mailsession * session,
struct mailmessage_list * env_list)
{
newsnntp * nntp;
int r;
struct nntp_session_state_data * data;
clist * list;
int done;
clistiter * cur;
uint32_t first_seq;
unsigned int i;
nntp = get_nntp_session(session);
data = get_data(session);
if (data->nntp_group_info == NULL)
return MAIL_ERROR_BAD_STATE;