[dovecot-cvs] dovecot/src/lib-imap imap-util.c, 1.10, 1.11 imap-util.h, 1.8, 1.9

cras at procontrol.fi cras at procontrol.fi
Sun May 2 23:32:18 EEST 2004


Update of /home/cvs/dovecot/src/lib-imap
In directory talvi:/tmp/cvs-serv3311/lib-imap

Modified Files:
	imap-util.c imap-util.h 
Log Message:
s/custom flags/keywords/



Index: imap-util.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-util.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- imap-util.c	27 Apr 2004 20:25:53 -0000	1.10
+++ imap-util.c	2 May 2004 20:32:15 -0000	1.11
@@ -11,8 +11,6 @@
 	const char *sysflags;
 	unsigned int i;
 
-	i_assert(flags->custom_flags_count <= MAIL_CUSTOM_FLAGS_COUNT);
-
 	if (flags == 0)
 		return "";
 
@@ -28,33 +26,17 @@
 	if (*sysflags != '\0')
 		sysflags++;
 
-	if (flags->custom_flags_count == 0)
+	if (flags->keywords_count == 0)
 		return sysflags;
 
-	/* we have custom flags too */
+	/* we have keywords too */
 	str = t_str_new(256);
 	str_append(str, sysflags);
 
-#if 1
-	for (i = 0; i < flags->custom_flags_count; i++) {
+	for (i = 0; i < flags->keywords_count; i++) {
 		if (str_len(str) > 0)
 			str_append_c(str, ' ');
-		str_append(str, flags->custom_flags[i]);
-	}
-#else // FIXME
-	if ((flags->flags & MAIL_CUSTOM_FLAGS_MASK) == 0)
-		return sysflags;
-
-	for (i = 0; i < flags->custom_flags_count; i++) {
-		if (flags->flags & (1 << (i + MAIL_CUSTOM_FLAG_1_BIT))) {
-			name = flags->custom_flags[i];
-			if (name != NULL && *name != '\0') {
-				if (str_len(str) > 0)
-					str_append_c(str, ' ');
-				str_append(str, name);
-			}
-		}
+		str_append(str, flags->keywords[i]);
 	}
-#endif
 	return str_c(str);
 }

Index: imap-util.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-util.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- imap-util.h	27 Apr 2004 20:25:53 -0000	1.8
+++ imap-util.h	2 May 2004 20:32:15 -0000	1.9
@@ -3,20 +3,7 @@
 
 struct mail_full_flags;
 
-/* growing number of flags isn't very easy. biggest problem is that they're
-   stored into unsigned int, which is 32bit almost everywhere. another thing
-   to remember is that with maildir format, the custom flags are stored into
-   file name using 'a'..'z' letters which gets us exactly the needed 26
-   flags. if more is added, the current code breaks. */
-enum {
-	MAIL_CUSTOM_FLAG_1_BIT	= 6,
-	MAIL_CUSTOM_FLAGS_COUNT	= 26,
-
-	MAIL_FLAGS_COUNT	= 32
-};
-
-/* Return flags as a space separated string. If custom flags don't have entry
-   in flags->custom_flags[], or if it's NULL or "" the flag s ignored. */
+/* Return flags as a space separated string. */
 const char *imap_write_flags(const struct mail_full_flags *flags);
 
 #endif



More information about the dovecot-cvs mailing list