diff options
author | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-13 07:20:16 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-13 07:20:16 +0800 |
commit | ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120 (patch) | |
tree | ad060fbbb1152e282a6bbba966fb2e282b72409c /camel | |
parent | 9d229d236a05e5bc80efed761080341e8bb56397 (diff) | |
download | gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.tar gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.tar.gz gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.tar.bz2 gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.tar.lz gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.tar.xz gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.tar.zst gsoc2013-evolution-ee7f4d32f9f2c9b9f1a5a291bc16b9bd5aac5120.zip |
pop provider now uses the crlf filter
svn path=/trunk/; revision=3538
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 3 | ||||
-rw-r--r-- | camel/camel-mime-filter-crlf.c | 2 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-folder.c | 18 |
3 files changed, 19 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 2bf9726a94..77e7500988 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,8 @@ 2000-06-12 Jeffrey Stedfast <fejj@helixcode.com> + * providers/pop3/camel-pop3-folder.c (get_message_by_uid): Now uses + the camel-mime-filter-crlf decoder when retrieving messages. + * camel-mime-filter-smtp.c: Deprecated. * providers/smtp/camel-smtp-transport.c (smtp_data): Updated to use diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c index 63ebfca62b..5cc409d554 100644 --- a/camel/camel-mime-filter-crlf.c +++ b/camel/camel-mime-filter-crlf.c @@ -84,7 +84,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace, if (*p == '\n') *q++ = '\r'; else - if (do_dots && *(p - 1) == '\n' && *p == '.' && *(p + 1) != '.') + if (do_dots && *(p - 1) == '\n' && *p == '.') *q++ = '.'; *q++ = *p++; } diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index 7355bd048b..8bdcc6a3e2 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -27,7 +27,9 @@ #include "camel-pop3-store.h" #include "camel-exception.h" #include "camel-stream-mem.h" +#include "camel-stream-filter.h" #include "camel-mime-message.h" +#include "camel-mime-filter-crlf.h" #include <stdlib.h> #include <string.h> @@ -140,10 +142,12 @@ pop3_close (CamelFolder *folder, gboolean expunge, CamelException *ex) static CamelMimeMessage * get_message_by_uid (CamelFolder *folder, const char *uid, CamelException *ex) { - int status; + int status, id; char *result, *body; CamelStream *msgstream; + CamelStreamFilter *f_stream; CamelMimeMessage *msg; + CamelMimeFilter *filter; status = camel_pop3_command (CAMEL_POP3_STORE (folder->parent_store), &result, "RETR %d", atoi (uid)); @@ -171,10 +175,18 @@ get_message_by_uid (CamelFolder *folder, const char *uid, CamelException *ex) msgstream = camel_stream_mem_new_with_buffer (body, strlen (body)); g_free (body); + + f_stream = camel_stream_filter_new_with_stream (msgstream); + filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS); + id = camel_stream_filter_add (f_stream, CAMEL_MIME_FILTER (filter)); + msg = camel_mime_message_new (); - camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), - msgstream); + camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), CAMEL_STREAM (f_stream)); + + camel_stream_filter_remove (f_stream, id); + camel_stream_close (CAMEL_STREAM (f_stream)); gtk_object_unref (GTK_OBJECT (msgstream)); + gtk_object_unref (GTK_OBJECT (f_stream)); return msg; } |