From 734a27187b7c4495f377c8533f9affdcf860dbbc Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 6 Feb 2004 06:31:02 +0000 Subject: changed to return a boolean to indicate if the flags were actually changed 2004-02-06 Not Zed * 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 --- camel/providers/local/camel-mbox-folder.c | 6 +++--- camel/providers/nntp/camel-nntp-folder.c | 4 ++-- camel/providers/pop3/camel-pop3-folder.c | 17 +++++++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'camel/providers') 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 -- cgit v1.2.3