aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-06 14:31:02 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-06 14:31:02 +0800
commit734a27187b7c4495f377c8533f9affdcf860dbbc (patch)
treed4e7496e6844564a592706e0fd3f74e5d4d0e4c6 /camel/providers
parent9fe2942fe8ed2a561c9a3098f8a3655ae2691fcd (diff)
downloadgsoc2013-evolution-734a27187b7c4495f377c8533f9affdcf860dbbc.tar.gz
gsoc2013-evolution-734a27187b7c4495f377c8533f9affdcf860dbbc.tar.zst
gsoc2013-evolution-734a27187b7c4495f377c8533f9affdcf860dbbc.zip
changed to return a boolean to indicate if the flags were actually changed
2004-02-06 Not Zed <NotZed@Ximian.com> * camel-folder.c (camel_folder_set_message_flags): changed to return a boolean to indicate if the flags were actually changed or not. Fixed all implementors. svn path=/trunk/; revision=24643
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/local/camel-mbox-folder.c6
-rw-r--r--camel/providers/nntp/camel-nntp-folder.c4
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c17
3 files changed, 18 insertions, 9 deletions
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index 9c3a7036f2..f06d4e31f5 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -59,7 +59,7 @@ static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *e
static void mbox_unlock(CamelLocalFolder *lf);
#ifdef STATUS_PINE
-static void mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
+static gboolean mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
#endif
static void mbox_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gboolean value);
@@ -496,7 +496,7 @@ fail:
}
#ifdef STATUS_PINE
-static void
+static gboolean
mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
{
/* Basically, if anything could change the Status line, presume it does */
@@ -506,7 +506,7 @@ mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guin
set |= CAMEL_MESSAGE_FOLDER_XEVCHANGE|CAMEL_MESSAGE_FOLDER_FLAGGED;
}
- ((CamelFolderClass *)parent_class)->set_message_flags(folder, uid, flags, set);
+ return ((CamelFolderClass *)parent_class)->set_message_flags(folder, uid, flags, set);
}
#endif
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index c0d7093a1c..6a6851232f 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -99,10 +99,10 @@ nntp_folder_sync_offline (CamelFolder *folder, CamelException *ex)
camel_folder_summary_save (folder->summary);
}
-static void
+static gboolean
nntp_folder_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
{
- ((CamelFolderClass *) folder_class)->set_message_flags (folder, uid, flags, set);
+ return ((CamelFolderClass *) folder_class)->set_message_flags (folder, uid, flags, set);
}
static CamelStream *
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index db77ad8191..edb71802bc 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -54,7 +54,7 @@ static void pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex
static gint pop3_get_message_count (CamelFolder *folder);
static GPtrArray *pop3_get_uids (CamelFolder *folder);
static CamelMimeMessage *pop3_get_message (CamelFolder *folder, const char *uid, CamelException *ex);
-static void pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
+static gboolean pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
static void
camel_pop3_folder_class_init (CamelPOP3FolderClass *camel_pop3_folder_class)
@@ -522,15 +522,24 @@ fail:
return message;
}
-static void
+static gboolean
pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set)
{
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
CamelPOP3FolderInfo *fi;
+ gboolean res = FALSE;
fi = g_hash_table_lookup(pop3_folder->uids_uid, uid);
- if (fi)
- fi->flags = (fi->flags & ~flags) | (set & flags);
+ if (fi) {
+ guint32 new = (fi->flags & ~flags) | (set & flags);
+
+ if (fi->flags != new) {
+ fi->flags = new;
+ res = TRUE;
+ }
+ }
+
+ return res;
}
static gint