aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-03-28 09:57:59 +0800
committerDan Winship <danw@src.gnome.org>2000-03-28 09:57:59 +0800
commit15287c0ce663905936d69acd7874d9efea5cb285 (patch)
treec418ab9d8e63befcfa50fcff326494a96fb2f201 /camel/camel-folder.c
parent03bcc319cfa2f92e86da72d0bd9f6040f4800aa0 (diff)
downloadgsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.tar
gsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.tar.gz
gsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.tar.bz2
gsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.tar.lz
gsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.tar.xz
gsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.tar.zst
gsoc2013-evolution-15287c0ce663905936d69acd7874d9efea5cb285.zip
add delete_message_by_{number,uid}.
* camel-folder.[ch]: add delete_message_by_{number,uid}. * providers/pop3/camel-pop3-folder.[ch]: implement delete_message_by_uid. Add a close method to do expunging of deleted messages if requested. * providers/pop3/camel-pop3-store.[ch]: support for CamelPop3Folder::close. (You have to close the connection in order to expunge the folder, thus the store may be connected in the CamelService::is_connected sense when it is not actually connected to the server.) Also some bugfixes. svn path=/trunk/; revision=2203
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r--camel/camel-folder.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index f26921526f..8abc5d177b 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -104,6 +104,9 @@ static gboolean _has_message_number_capability (CamelFolder *folder);
static CamelMimeMessage *_get_message_by_number (CamelFolder *folder,
gint number,
CamelException *ex);
+static void _delete_message_by_number (CamelFolder *folder,
+ gint number,
+ CamelException *ex);
static gint _get_message_count (CamelFolder *folder,
CamelException *ex);
@@ -129,6 +132,9 @@ static const gchar *_get_message_uid (CamelFolder *folder,
static CamelMimeMessage *_get_message_by_uid (CamelFolder *folder,
const gchar *uid,
CamelException *ex);
+static void _delete_message_by_uid (CamelFolder *folder,
+ const gchar *uid,
+ CamelException *ex);
@@ -168,12 +174,14 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class)
camel_folder_class->expunge = _expunge;
camel_folder_class->has_message_number_capability = _has_message_number_capability;
camel_folder_class->get_message_by_number = _get_message_by_number;
+ camel_folder_class->delete_message_by_number = _delete_message_by_number;
camel_folder_class->get_message_count = _get_message_count;
camel_folder_class->append_message = _append_message;
camel_folder_class->list_permanent_flags = _list_permanent_flags;
camel_folder_class->copy_message_to = _copy_message_to;
camel_folder_class->get_message_uid = _get_message_uid;
camel_folder_class->get_message_by_uid = _get_message_by_uid;
+ camel_folder_class->delete_message_by_uid = _delete_message_by_uid;
camel_folder_class->get_uid_list = _get_uid_list;
/* virtual method overload */
@@ -1098,6 +1106,35 @@ camel_folder_get_message_by_number (CamelFolder *folder, gint number, CamelExcep
}
+static void
+_delete_message_by_number (CamelFolder *folder, gint number,
+ CamelException *ex)
+{
+ CAMEL_LOG_WARNING ("Calling CamelFolder::delete_message_by_number "
+ "directly. Should be overloaded\n");
+}
+
+/**
+ * camel_folder_delete_message_by_number: delete the message
+ * corresponding to that number in the folder
+ * @folder: a CamelFolder object
+ * @number: the number of the message within the folder.
+ *
+ * Delete the message corresponding to that number within the folder.
+ *
+ **/
+void
+camel_folder_delete_message_by_number (CamelFolder *folder, gint number,
+ CamelException *ex)
+{
+ g_assert (folder != NULL);
+ g_assert (camel_folder_is_open (folder));
+
+ return CF_CLASS (folder)->delete_message_by_number (folder, number,
+ ex);
+}
+
+
static gint
_get_message_count (CamelFolder *folder, CamelException *ex)
{
@@ -1354,6 +1391,34 @@ camel_folder_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelEx
return CF_CLASS (folder)->get_message_by_uid (folder, uid, ex);
}
+static void
+_delete_message_by_uid (CamelFolder *folder, const gchar *uid,
+ CamelException *ex)
+{
+ CAMEL_LOG_WARNING ("Calling CamelFolder::delete_message_by_uid "
+ "directly. Should be overloaded\n");
+}
+
+
+/**
+ * camel_folder_delete_message_by_uid: Delete a message by its UID in a folder
+ * @folder: the folder object
+ * @uid: the UID
+ *
+ * Delete a message from a folder given its UID.
+ *
+ **/
+void
+camel_folder_delete_message_by_uid (CamelFolder *folder, const gchar *uid,
+ CamelException *ex)
+{
+ g_assert (folder != NULL);
+ g_assert (folder->has_uid_capability);
+ g_assert (camel_folder_is_open (folder));
+
+ return CF_CLASS (folder)->delete_message_by_uid (folder, uid, ex);
+}
+
static GList *
_get_uid_list (CamelFolder *folder, CamelException *ex)
{