[dovecot-cvs] dovecot/src/lib-imap imap-util.c, 1.11,
1.12 imap-util.h, 1.9, 1.10
cras at dovecot.org
cras at dovecot.org
Mon Jul 12 14:35:53 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.15,
1.16
- Next message: [dovecot-cvs] dovecot/src/imap Makefile.am, 1.25, 1.26 client.h,
1.18, 1.19 cmd-idle.c, 1.10, 1.11 cmd-select.c, 1.27,
1.28 cmd-status.c, 1.17, 1.18 cmd-store.c, 1.23,
1.24 commands-util.c, 1.32, 1.33 imap-fetch.c, 1.19,
1.20 imap-sync.c, NONE, 1.1 imap-sync.h, NONE,
1.1 mail-storage-callbacks.c, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-imap
In directory talvi:/tmp/cvs-serv2470/lib-imap
Modified Files:
imap-util.c imap-util.h
Log Message:
Broke mailbox_sync() into iterator.
Index: imap-util.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-util.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- imap-util.c 2 May 2004 20:32:15 -0000 1.11
+++ imap-util.c 12 Jul 2004 11:35:51 -0000 1.12
@@ -5,38 +5,33 @@
#include "mail-types.h"
#include "imap-util.h"
-const char *imap_write_flags(const struct mail_full_flags *flags)
+void imap_write_flags(string_t *dest, const struct mail_full_flags *flags)
{
- string_t *str;
- const char *sysflags;
unsigned int i;
+ size_t size;
- if (flags == 0)
- return "";
-
- sysflags = t_strconcat(
- (flags->flags & MAIL_ANSWERED) ? " \\Answered" : "",
- (flags->flags & MAIL_FLAGGED) ? " \\Flagged" : "",
- (flags->flags & MAIL_DELETED) ? " \\Deleted" : "",
- (flags->flags & MAIL_SEEN) ? " \\Seen" : "",
- (flags->flags & MAIL_DRAFT) ? " \\Draft" : "",
- (flags->flags & MAIL_RECENT) ? " \\Recent" : "",
- NULL);
-
- if (*sysflags != '\0')
- sysflags++;
-
- if (flags->keywords_count == 0)
- return sysflags;
-
- /* we have keywords too */
- str = t_str_new(256);
- str_append(str, sysflags);
+ size = str_len(dest);
+ if ((flags->flags & MAIL_ANSWERED) != 0)
+ str_append(dest, "\\Answered ");
+ if ((flags->flags & MAIL_FLAGGED) != 0)
+ str_append(dest, "\\Flagged ");
+ if ((flags->flags & MAIL_DELETED) != 0)
+ str_append(dest, "\\Deleted ");
+ if ((flags->flags & MAIL_SEEN) != 0)
+ str_append(dest, "\\Seen ");
+ if ((flags->flags & MAIL_DRAFT) != 0)
+ str_append(dest, "\\Draft ");
+ if ((flags->flags & MAIL_RECENT) != 0)
+ str_append(dest, "\\Recent ");
- for (i = 0; i < flags->keywords_count; i++) {
- if (str_len(str) > 0)
- str_append_c(str, ' ');
- str_append(str, flags->keywords[i]);
+ if (flags->keywords_count > 0) {
+ /* we have keywords too */
+ for (i = 0; i < flags->keywords_count; i++) {
+ str_append(dest, flags->keywords[i]);
+ str_append_c(dest, ' ');
+ }
}
- return str_c(str);
+
+ if (str_len(dest) != size)
+ str_truncate(dest, str_len(dest)-1);
}
Index: imap-util.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-util.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- imap-util.h 2 May 2004 20:32:15 -0000 1.9
+++ imap-util.h 12 Jul 2004 11:35:51 -0000 1.10
@@ -4,6 +4,6 @@
struct mail_full_flags;
/* Return flags as a space separated string. */
-const char *imap_write_flags(const struct mail_full_flags *flags);
+void imap_write_flags(string_t *dest, const struct mail_full_flags *flags);
#endif
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.15,
1.16
- Next message: [dovecot-cvs] dovecot/src/imap Makefile.am, 1.25, 1.26 client.h,
1.18, 1.19 cmd-idle.c, 1.10, 1.11 cmd-select.c, 1.27,
1.28 cmd-status.c, 1.17, 1.18 cmd-store.c, 1.23,
1.24 commands-util.c, 1.32, 1.33 imap-fetch.c, 1.19,
1.20 imap-sync.c, NONE, 1.1 imap-sync.h, NONE,
1.1 mail-storage-callbacks.c, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list