aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2000-06-13 08:27:30 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-13 08:27:30 +0800
commitc0748cf4f1e4a0178f5218ae73004d3d8c3d4d44 (patch)
tree23c34697126702429513c5924da8b59127fea3c9
parent6c12613258f40118afae97e3868e0c007912bf28 (diff)
downloadgsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.tar
gsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.tar.gz
gsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.tar.bz2
gsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.tar.lz
gsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.tar.xz
gsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.tar.zst
gsoc2013-evolution-c0748cf4f1e4a0178f5218ae73004d3d8c3d4d44.zip
implemented a temp hack for the imap fetch by uid code
(works something like the POP code, should be fixed to work like we originally planned) svn path=/trunk/; revision=3540
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/providers/imap/camel-imap-folder.c43
-rw-r--r--composer/e-msg-composer.c26
3 files changed, 43 insertions, 30 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 77e7500988..d844cfa2d5 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2000-06-12 Jeffrey Stedfast <fejj@helixcode.com>
+ * providers/imap/camel-imap-folder.c (imap_get_message_by_uid):
+ Works like the POP fetch code, should work for temporarily until
+ we get around to coding it the way it "Should Be".
+
* providers/pop3/camel-pop3-folder.c (get_message_by_uid): Now uses
the camel-mime-filter-crlf decoder when retrieving messages.
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 4e6e184c48..f09cae6039 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -606,28 +606,47 @@ static CamelMimeMessage *
imap_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex)
{
CamelImapStream *imap_stream;
- CamelMimeMessage *message;
+ CamelStream *msgstream;
+ CamelStreamFilter *f_stream; /* will be used later w/ crlf filter */
+ CamelMimeFilter *filter; /* crlf/dot filter */
+ CamelMimeMessage *msg;
CamelMimePart *part;
CamelDataWrapper *cdw;
gchar *cmdbuf;
+ int id;
/* TODO: fetch the correct part, get rid of the hard-coded stuff */
- cmdbuf = g_strdup_printf("UID FETCH %s BODY[TEXT]", uid);
- imap_stream = camel_imap_stream_new(folder, cmdbuf);
- g_free(cmdbuf);
+ cmdbuf = g_strdup_printf ("UID FETCH %s BODY[TEXT]", uid);
+ imap_stream = camel_imap_stream_new (folder, cmdbuf);
+ g_free (cmdbuf);
- message = camel_mime_message_new();
+
+ /* Temp hack - basically we read in the entire message instead of getting a part as it's needed */
+ msgstream = camel_stream_mem_new ();
+ camel_stream_write_to_stream (msgstream, CAMEL_STREAM (imap_stream));
+ gtk_object_unref (GTK_OBJECT (imap_stream));
+
+ 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));
- cdw = camel_data_wrapper_new();
- camel_data_wrapper_construct_from_stream(cdw, imap_stream);
- gtk_object_unref(GTK_OBJECT (imap_stream));
+ msg = camel_mime_message_new ();
- camel_data_wrapper_set_mime_type (cdw, "text/plain");
+ /*cdw = camel_data_wrapper_new ();*/
+ /*camel_data_wrapper_construct_from_stream (cdw, CAMEL_STREAM (f_stream));*/
+ 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));
+
+ /*camel_data_wrapper_set_mime_type (cdw, "text/plain");*/
- camel_medium_set_content_object (CAMEL_MEDIUM (message), CAMEL_DATA_WRAPPER (cdw));
- gtk_object_unref (GTK_OBJECT (cdw));
+ /*camel_medium_set_content_object (CAMEL_MEDIUM (msg), CAMEL_DATA_WRAPPER (cdw));*/
+ /*gtk_object_unref (GTK_OBJECT (cdw));*/
- return message;
+ return msg;
}
#if 0
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 57fac7d38c..45194184cc 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -59,11 +59,9 @@
#endif
-
#define DEFAULT_WIDTH 600
#define DEFAULT_HEIGHT 500
-
enum {
SEND,
POSTPONE,
@@ -74,7 +72,6 @@ static guint signals[LAST_SIGNAL] = { 0 };
static GnomeAppClass *parent_class = NULL;
-
static GtkWidget *
create_editor (EMsgComposer *composer)
{
@@ -90,7 +87,6 @@ create_editor (EMsgComposer *composer)
return control;
}
-
static void
free_string_list (GList *list)
{
@@ -128,6 +124,7 @@ get_editor_text (BonoboWidget *editor, char *format)
/* FIXME. Some error message. */
return NULL;
}
+
if (ev._major != CORBA_SYSTEM_EXCEPTION)
CORBA_Object_release (persist, &ev);
@@ -243,8 +240,7 @@ build_message (EMsgComposer *composer)
new = camel_mime_message_new ();
- e_msg_composer_hdrs_to_message (E_MSG_COMPOSER_HDRS (composer->hdrs),
- new);
+ e_msg_composer_hdrs_to_message (E_MSG_COMPOSER_HDRS (composer->hdrs), new);
for (i = 0; i < composer->extra_hdr_names->len; i++) {
camel_medium_add_header (CAMEL_MEDIUM (new),
composer->extra_hdr_names->pdata[i],
@@ -292,40 +288,34 @@ build_message (EMsgComposer *composer)
gtk_object_unref (GTK_OBJECT (body));
break;
case MSG_FORMAT_PLAIN:
- camel_mime_part_set_content (part, fmt,
- strlen (fmt), "text/plain");
+ camel_mime_part_set_content (part, fmt, strlen (fmt), "text/plain");
g_free(fmt);
break;
}
camel_multipart_add_part (multipart, part);
gtk_object_unref (GTK_OBJECT (part));
- e_msg_composer_attachment_bar_to_multipart (attachment_bar,
- multipart);
+ e_msg_composer_attachment_bar_to_multipart (attachment_bar, multipart);
- camel_medium_set_content_object (CAMEL_MEDIUM (new),
- CAMEL_DATA_WRAPPER (multipart));
+ camel_medium_set_content_object (CAMEL_MEDIUM (new), CAMEL_DATA_WRAPPER (multipart));
gtk_object_unref (GTK_OBJECT (multipart));
} else {
CamelDataWrapper *cdw;
CamelStream *stream;
switch (type) {
case MSG_FORMAT_ALTERNATIVE:
- camel_medium_set_content_object (CAMEL_MEDIUM (new),
- CAMEL_DATA_WRAPPER (body));
+ camel_medium_set_content_object (CAMEL_MEDIUM (new), CAMEL_DATA_WRAPPER (body));
gtk_object_unref (GTK_OBJECT (body));
break;
case MSG_FORMAT_PLAIN:
- stream = camel_stream_mem_new_with_buffer (fmt,
- strlen (fmt));
+ stream = camel_stream_mem_new_with_buffer (fmt, strlen (fmt));
cdw = camel_data_wrapper_new ();
camel_data_wrapper_construct_from_stream (cdw, stream);
gtk_object_unref (GTK_OBJECT (stream));
camel_data_wrapper_set_mime_type (cdw, "text/plain");
- camel_medium_set_content_object (CAMEL_MEDIUM (new),
- CAMEL_DATA_WRAPPER (cdw));
+ camel_medium_set_content_object (CAMEL_MEDIUM (new), CAMEL_DATA_WRAPPER (cdw));
gtk_object_unref (GTK_OBJECT (cdw));
g_free (fmt);
break;