aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-10 22:27:22 +0800
committerDan Winship <danw@src.gnome.org>2000-04-10 22:27:22 +0800
commit7d8c98fb7d35db162f6e355a07e4b5ed3c2e1de7 (patch)
tree9d8eafbf60cdcfb39e5e817b0d045375cf3abe03 /camel
parent325ed84013a410201fbb3b2e3e41395e40a42f1b (diff)
downloadgsoc2013-evolution-7d8c98fb7d35db162f6e355a07e4b5ed3c2e1de7.tar.gz
gsoc2013-evolution-7d8c98fb7d35db162f6e355a07e4b5ed3c2e1de7.tar.zst
gsoc2013-evolution-7d8c98fb7d35db162f6e355a07e4b5ed3c2e1de7.zip
implement get_message_by_number for the mail fetch code.
* providers/mbox/camel-mbox-folder.c (_get_message_by_number): implement get_message_by_number for the mail fetch code. svn path=/trunk/; revision=2358
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c26
2 files changed, 29 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 50cb012b93..922c67fe25 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-10 Dan Winship <danw@helixcode.com>
+
+ * providers/mbox/camel-mbox-folder.c (_get_message_by_number):
+ implement get_message_by_number for the mail fetch code.
+
2000-04-09 Jeffrey Stedfast <fejj@stampede.org>
* providers/smtp/camel-smtp-transport.c: reformatted to fit
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 8e1fe00402..685e2824e2 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -70,7 +70,7 @@ static gboolean _create(CamelFolder *folder, CamelException *ex);
static gboolean _delete (CamelFolder *folder, gboolean recurse, CamelException *ex);
static gboolean _delete_messages (CamelFolder *folder, CamelException *ex);
static GList *_list_subfolders (CamelFolder *folder, CamelException *ex);
-/* static CamelMimeMessage *_get_message_by_number (CamelFolder *folder, gint number, CamelException *ex);*/
+static CamelMimeMessage *_get_message_by_number (CamelFolder *folder, gint number, CamelException *ex);
static gint _get_message_count (CamelFolder *folder, CamelException *ex);
static void _append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
static GList *_get_uid_list (CamelFolder *folder, CamelException *ex);
@@ -103,7 +103,7 @@ camel_mbox_folder_class_init (CamelMboxFolderClass *camel_mbox_folder_class)
camel_folder_class->delete = _delete;
camel_folder_class->delete_messages = _delete_messages;
camel_folder_class->list_subfolders = _list_subfolders;
- /* camel_folder_class->get_message_by_number = _get_message_by_number; */
+ camel_folder_class->get_message_by_number = _get_message_by_number;
camel_folder_class->get_message_count = _get_message_count;
camel_folder_class->append_message = _append_message;
camel_folder_class->get_uid_list = _get_uid_list;
@@ -998,8 +998,30 @@ _get_uid_list (CamelFolder *folder, CamelException *ex)
+static CamelMimeMessage *
+_get_message_by_number (CamelFolder *folder, gint number, CamelException *ex)
+{
+ GArray *message_info_array;
+ CamelMboxSummaryInformation *message_info;
+ char uidbuf[20];
+ message_info_array =
+ CAMEL_MBOX_SUMMARY (folder->summary)->message_info;
+ if (number > message_info_array->len) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
+ "No such message %d in folder `%s'.",
+ number, folder->name);
+ return NULL;
+ }
+
+ message_info =
+ (CamelMboxSummaryInformation *)(message_info_array->data) +
+ (number - 1);
+ sprintf (uidbuf, "%lu", message_info->uid);
+
+ return _get_message_by_uid (folder, uidbuf, ex);
+}
static CamelMimeMessage *