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

cras at procontrol.fi cras at procontrol.fi
Tue Apr 27 23:25:55 EEST 2004


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

Modified Files:
	imap-util.c imap-util.h 
Log Message:
importing new index code. mbox still broken.



Index: imap-util.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-util.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- imap-util.c	23 Jul 2003 01:44:16 -0000	1.9
+++ imap-util.c	27 Apr 2004 20:25:53 -0000	1.10
@@ -2,12 +2,13 @@
 
 #include "lib.h"
 #include "str.h"
+#include "mail-types.h"
 #include "imap-util.h"
 
 const char *imap_write_flags(const struct mail_full_flags *flags)
 {
 	string_t *str;
-	const char *sysflags, *name;
+	const char *sysflags;
 	unsigned int i;
 
 	i_assert(flags->custom_flags_count <= MAIL_CUSTOM_FLAGS_COUNT);
@@ -27,13 +28,23 @@
 	if (*sysflags != '\0')
 		sysflags++;
 
-	if ((flags->flags & MAIL_CUSTOM_FLAGS_MASK) == 0)
+	if (flags->custom_flags_count == 0)
 		return sysflags;
 
 	/* we have custom flags too */
 	str = t_str_new(256);
 	str_append(str, sysflags);
 
+#if 1
+	for (i = 0; i < flags->custom_flags_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];
@@ -44,6 +55,6 @@
 			}
 		}
 	}
-
+#endif
 	return str_c(str);
 }

Index: imap-util.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-util.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- imap-util.h	10 Aug 2003 23:56:22 -0000	1.7
+++ imap-util.h	27 Apr 2004 20:25:53 -0000	1.8
@@ -1,33 +1,7 @@
 #ifndef __IMAP_UTIL_H
 #define __IMAP_UTIL_H
 
-enum modify_type {
-	MODIFY_ADD,
-	MODIFY_REMOVE,
-	MODIFY_REPLACE
-};
-
-enum mail_flags {
-	MAIL_ANSWERED		= 0x0000001,
-	MAIL_FLAGGED		= 0x0000002,
-	MAIL_DELETED		= 0x0000004,
-	MAIL_SEEN		= 0x0000008,
-	MAIL_DRAFT		= 0x0000010,
-	MAIL_RECENT		= 0x0000020,
-
-	/* rest of the bits are custom flags */
-	MAIL_CUSTOM_FLAG_1      = 0x0000040,
-
-	MAIL_SYSTEM_FLAGS_MASK	= 0x000003f,
-	MAIL_CUSTOM_FLAGS_MASK	= 0xfffffc0
-};
-
-struct mail_full_flags {
-	enum mail_flags flags;
-
-	const char **custom_flags;
-	unsigned int custom_flags_count;
-};
+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



More information about the dovecot-cvs mailing list