aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-08-11 15:43:50 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-08-11 15:43:50 +0800
commit0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d (patch)
treea5bb59031f5757fcd315f79d16fd245486bb776a /camel/providers
parent58752d028e6f7519e625a47827846a813e65e4e6 (diff)
downloadgsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.tar
gsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.tar.gz
gsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.tar.bz2
gsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.tar.lz
gsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.tar.xz
gsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.tar.zst
gsoc2013-evolution-0227bb16b26c2d59c4c2ed6495da1bcd8c3d525d.zip
Implement. (mh_get_message_user_tag): Implement.
2000-08-11 Not Zed <NotZed@HelixCode.com> * providers/mh/camel-mh-folder.c (mh_set_message_user_tag): Implement. (mh_get_message_user_tag): Implement. * providers/mbox/camel-mbox-folder.c (mbox_get_message_user_tag): (mbox_set_message_user_tag): Implement. * camel-folder.c (camel_folder_set_message_user_tag): Routine to set message tags. (camel_folder_get_message_user_tag): And accessor. svn path=/trunk/; revision=4729
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c31
-rw-r--r--camel/providers/mh/camel-mh-folder.c29
2 files changed, 60 insertions, 0 deletions
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 00921637eb..d533b675b9 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -83,6 +83,8 @@ static guint32 mbox_get_message_flags(CamelFolder *folder, const char *uid);
static void mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
static gboolean mbox_get_message_user_flag(CamelFolder *folder, const char *uid, const char *name);
static void mbox_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value);
+static const char *mbox_get_message_user_tag(CamelFolder *folder, const char *uid, const char *name);
+static void mbox_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value);
static void mbox_finalize(CamelObject * object);
@@ -121,6 +123,8 @@ camel_mbox_folder_class_init(CamelMboxFolderClass * camel_mbox_folder_class)
camel_folder_class->set_message_flags = mbox_set_message_flags;
camel_folder_class->get_message_user_flag = mbox_get_message_user_flag;
camel_folder_class->set_message_user_flag = mbox_set_message_user_flag;
+ camel_folder_class->get_message_user_tag = mbox_get_message_user_tag;
+ camel_folder_class->set_message_user_tag = mbox_set_message_user_tag;
}
static void
@@ -592,3 +596,30 @@ mbox_set_message_user_flag(CamelFolder *folder, const char *uid, const char *nam
camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary));
camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
}
+
+static const char *mbox_get_message_user_tag(CamelFolder *folder, const char *uid, const char *name)
+{
+ CamelMessageInfo *info;
+ CamelMboxFolder *mf = CAMEL_MBOX_FOLDER(folder);
+
+ info = camel_folder_summary_uid(CAMEL_FOLDER_SUMMARY(mf->summary), uid);
+ g_return_val_if_fail(info != NULL, FALSE);
+
+ return camel_tag_get(&info->user_tags, name);
+}
+
+static void mbox_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value)
+{
+ CamelMessageInfo *info;
+ CamelMboxFolder *mf = CAMEL_MBOX_FOLDER(folder);
+
+ info = camel_folder_summary_uid(CAMEL_FOLDER_SUMMARY(mf->summary), uid);
+ g_return_if_fail(info != NULL);
+
+ camel_tag_set(&info->user_tags, name, value);
+ info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+ camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary));
+ camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
+}
+
+
diff --git a/camel/providers/mh/camel-mh-folder.c b/camel/providers/mh/camel-mh-folder.c
index 6b78df9b14..e899318f9f 100644
--- a/camel/providers/mh/camel-mh-folder.c
+++ b/camel/providers/mh/camel-mh-folder.c
@@ -77,6 +77,8 @@ static guint32 mh_get_message_flags(CamelFolder * folder, const char *uid);
static void mh_set_message_flags(CamelFolder * folder, const char *uid, guint32 flags, guint32 set);
static gboolean mh_get_message_user_flag(CamelFolder * folder, const char *uid, const char *name);
static void mh_set_message_user_flag(CamelFolder * folder, const char *uid, const char *name, gboolean value);
+static const char *mh_get_message_user_tag(CamelFolder *folder, const char *uid, const char *name);
+static void mh_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value);
static void mh_finalize(CamelObject * object);
@@ -113,6 +115,8 @@ static void camel_mh_folder_class_init(CamelObjectClass * camel_mh_folder_class)
camel_folder_class->set_message_flags = mh_set_message_flags;
camel_folder_class->get_message_user_flag = mh_get_message_user_flag;
camel_folder_class->set_message_user_flag = mh_set_message_user_flag;
+ camel_folder_class->get_message_user_flag = mh_get_message_user_tag;
+ camel_folder_class->set_message_user_flag = mh_set_message_user_tag;
}
static void mh_finalize(CamelObject * object)
@@ -497,3 +501,28 @@ static void mh_set_message_user_flag(CamelFolder * folder, const char *uid, cons
camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary));
camel_object_trigger_event (CAMEL_OBJECT(folder), "message_changed", (char *) uid);
}
+
+static const char *mh_get_message_user_tag(CamelFolder *folder, const char *uid, const char *name)
+{
+ CamelMessageInfo *info;
+ CamelMhFolder *mf = CAMEL_MH_FOLDER(folder);
+
+ info = camel_folder_summary_uid(CAMEL_FOLDER_SUMMARY(mf->summary), uid);
+ g_return_val_if_fail(info != NULL, FALSE);
+
+ return camel_tag_get(&info->user_tags, name);
+}
+
+static void mh_set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, const char *value)
+{
+ CamelMessageInfo *info;
+ CamelMhFolder *mf = CAMEL_MH_FOLDER(folder);
+
+ info = camel_folder_summary_uid(CAMEL_FOLDER_SUMMARY(mf->summary), uid);
+ g_return_if_fail(info != NULL);
+
+ camel_tag_set(&info->user_tags, name, value);
+ info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+ camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary));
+ camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
+}