[Users] Last tag not removed when imap flags (tags) are empty

Igor Mammedov imammedo at redhat.com
Thu Aug 16 15:32:43 CEST 2012


I'm evaluating claws for use as my mail-reader and stumbled upon problem with
tags.

the only/last tag on the message isn't removed when fetching flags from IMAP
server and fetch response doesn't have any tags in it.

steps to reproduce:
1. tag an untagged message in claws.
2. untag the message on server using another client
3. on the next sync claws will not remove tag from  the message tagged at step 1

following patch fixes issue for me.

Index: src/imap.c
===================================================================
RCS file: //claws/src/imap.c,v
retrieving revision 1.179.2.258
diff -u -r1.179.2.258 imap.c
--- src/imap.c	7 Jul 2012 07:09:27 -0000	1.179.2.258
+++ src/imap.c	16 Aug 2012 13:28:03 -0000
@@ -4804,10 +4804,9 @@
 				GSList *tags = g_hash_table_lookup(tags_hash, GINT_TO_POINTER(msginfo->msgnum));
 				GSList *cur;
 
-				if (tags != NULL) {
-					g_slist_free(msginfo->tags);
-					msginfo->tags = NULL;
-				}
+				g_slist_free(msginfo->tags);
+				msginfo->tags = NULL;
+
 				for (cur = tags; cur; cur = cur->next) {
 					gchar *real_tag = imap_modified_utf7_to_utf8(cur->data, TRUE);
 					gint id = 0;
@@ -4816,11 +4815,9 @@
 						id = tags_add_tag(real_tag);
 						got_alien_tags = TRUE;
 					}
-					if (!g_slist_find(msginfo->tags, GINT_TO_POINTER(id))) {
-						msginfo->tags = g_slist_append(
+					msginfo->tags = g_slist_append(
 								msginfo->tags,
 								GINT_TO_POINTER(id));
-					}
 					g_free(real_tag);
 				}
 				slist_free_strings(tags);



More information about the Users mailing list