Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/imap/commands-util.h @ 7057:81f4c9689c18 HEAD
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
optimized sending keywords with FETCH FLAGS.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 29 Dec 2007 07:11:12 +0200 |
parents | e4eb71ae8e96 |
children | 81806d402514 |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
5835
diff
changeset
|
1 #ifndef COMMANDS_UTIL_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
5835
diff
changeset
|
2 #define COMMANDS_UTIL_H |
0 | 3 |
2190
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
4 struct msgset_generator_context { |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
5 string_t *str; |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
6 uint32_t first_uid, last_uid; |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
7 }; |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
8 |
1041 | 9 struct mail_full_flags; |
3139 | 10 struct mailbox_keywords; |
1041 | 11 |
5298
143c5942e392
Added client_find_namespace(). Handle virtual != real hierarchy separators
Timo Sirainen <tss@iki.fi>
parents:
4451
diff
changeset
|
12 /* Finds namespace for given mailbox from namespaces. If not found, |
143c5942e392
Added client_find_namespace(). Handle virtual != real hierarchy separators
Timo Sirainen <tss@iki.fi>
parents:
4451
diff
changeset
|
13 sends "Unknown namespace" error message to client. */ |
5500
4862cb37106c
Moved namespace handling to lib-storage. Beginnings of namespace support for
Timo Sirainen <tss@iki.fi>
parents:
5298
diff
changeset
|
14 struct mail_namespace * |
5298
143c5942e392
Added client_find_namespace(). Handle virtual != real hierarchy separators
Timo Sirainen <tss@iki.fi>
parents:
4451
diff
changeset
|
15 client_find_namespace(struct client_command_context *cmd, const char **mailbox); |
1654
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
16 /* Finds mail storage for given mailbox from namespaces. If not found, |
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
17 sends "Unknown namespace" error message to client. */ |
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
18 struct mail_storage * |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
3139
diff
changeset
|
19 client_find_storage(struct client_command_context *cmd, const char **mailbox); |
1654
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
20 |
0 | 21 /* If should_exist is TRUE, this function returns TRUE if the mailbox |
22 exists. If it doesn't exist but would be a valid mailbox name, the | |
23 error message is prefixed with [TRYCREATE]. | |
24 | |
302 | 25 If should_exist is FALSE, the should_not_exist specifies if we should |
26 return TRUE or FALSE if mailbox doesn't exist. */ | |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
27 bool client_verify_mailbox_name(struct client_command_context *cmd, |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
28 const char *mailbox, |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
29 bool should_exist, bool should_not_exist); |
0 | 30 |
31 /* Returns TRUE if mailbox is selected. If not, sends "No mailbox selected" | |
32 error message to client. */ | |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
33 bool client_verify_open_mailbox(struct client_command_context *cmd); |
0 | 34 |
5611
44db6ddd5a17
Removed mail_storage_set_list_error(). Handle the errors directly.
Timo Sirainen <tss@iki.fi>
parents:
5500
diff
changeset
|
35 /* Send last mailbox list error message to client. */ |
44db6ddd5a17
Removed mail_storage_set_list_error(). Handle the errors directly.
Timo Sirainen <tss@iki.fi>
parents:
5500
diff
changeset
|
36 void client_send_list_error(struct client_command_context *cmd, |
44db6ddd5a17
Removed mail_storage_set_list_error(). Handle the errors directly.
Timo Sirainen <tss@iki.fi>
parents:
5500
diff
changeset
|
37 struct mailbox_list *list); |
0 | 38 /* Send last mail storage error message to client. */ |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
3139
diff
changeset
|
39 void client_send_storage_error(struct client_command_context *cmd, |
1654
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
40 struct mail_storage *storage); |
0 | 41 |
1212 | 42 /* Send untagged error message to client. */ |
1654
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
43 void client_send_untagged_storage_error(struct client *client, |
31c4bb26a1e9
Getting ready for namespaces. LIST is still broken with them.
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
44 struct mail_storage *storage); |
1021
81cbc1467097
Added support for UNSELECT extension with some cleanups for SELECT and CLOSE.
Timo Sirainen <tss@iki.fi>
parents:
988
diff
changeset
|
45 |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
46 /* Parse flags. Returns TRUE if successful, if not sends an error message to |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
47 client. */ |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
48 bool client_parse_mail_flags(struct client_command_context *cmd, |
5835
d59ed6a31b66
Added more consts to imap-parser API
Timo Sirainen <tss@iki.fi>
parents:
5611
diff
changeset
|
49 const struct imap_arg *args, |
d59ed6a31b66
Added more consts to imap-parser API
Timo Sirainen <tss@iki.fi>
parents:
5611
diff
changeset
|
50 enum mail_flags *flags_r, |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
51 const char *const **keywords_r); |
0 | 52 |
7057
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
53 /* Send FLAGS + PERMANENTFLAGS to client if they have changed, |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
54 or if selecting=TRUE. */ |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
55 void client_send_mailbox_flags(struct client *client, bool selecting); |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
56 /* Update client->keywords array. Use keywords=NULL when unselecting. */ |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
57 void client_update_mailbox_flags(struct client *client, |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
58 const ARRAY_TYPE(keywords) *keywords); |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
59 /* Convert keyword indexes to keyword names in selected mailbox. */ |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
60 const char *const * |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
61 client_get_keyword_names(struct client *client, ARRAY_TYPE(keywords) *dest, |
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6410
diff
changeset
|
62 const ARRAY_TYPE(keyword_indexes) *src); |
1168
03f1455664d7
Added setting to limit length of custom flag names.
Timo Sirainen <tss@iki.fi>
parents:
1041
diff
changeset
|
63 |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
64 bool mailbox_equals(struct mailbox *box1, struct mail_storage *storage2, |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3515
diff
changeset
|
65 const char *name2); |
2190
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
66 |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
67 void msgset_generator_init(struct msgset_generator_context *ctx, string_t *str); |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
68 void msgset_generator_next(struct msgset_generator_context *ctx, uint32_t uid); |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
69 void msgset_generator_finish(struct msgset_generator_context *ctx); |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
70 |
0 | 71 #endif |