Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/imap/cmd-close.c @ 3863:55df57c028d4 HEAD
Added "bool" type and changed all ints that were used as booleans to bool.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 13 Jan 2006 22:25:57 +0200 |
parents | 61abed5f7864 |
children | 928229f8b3e6 |
rev | line source |
---|---|
0 | 1 /* Copyright (C) 2002 Timo Sirainen */ |
2 | |
3 #include "common.h" | |
4 #include "commands.h" | |
1640
db14aa8e2b5c
API change for expunging messages. Not exactly what I wanted, but good
Timo Sirainen <tss@iki.fi>
parents:
1445
diff
changeset
|
5 #include "imap-expunge.h" |
0 | 6 |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3141
diff
changeset
|
7 bool cmd_close(struct client_command_context *cmd) |
0 | 8 { |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2676
diff
changeset
|
9 struct client *client = cmd->client; |
1212 | 10 struct mailbox *mailbox = client->mailbox; |
2676
542edc7f6091
Don't crash if CLOSEing without open mailbox.
Timo Sirainen <tss@iki.fi>
parents:
2190
diff
changeset
|
11 struct mail_storage *storage; |
1212 | 12 |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2676
diff
changeset
|
13 if (!client_verify_open_mailbox(cmd)) |
0 | 14 return TRUE; |
15 | |
2676
542edc7f6091
Don't crash if CLOSEing without open mailbox.
Timo Sirainen <tss@iki.fi>
parents:
2190
diff
changeset
|
16 storage = mailbox_get_storage(mailbox); |
1212 | 17 client->mailbox = NULL; |
0 | 18 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1654
diff
changeset
|
19 if (!mailbox_is_readonly(mailbox)) { |
2190
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1915
diff
changeset
|
20 if (!imap_expunge(mailbox, NULL)) |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1654
diff
changeset
|
21 client_send_untagged_storage_error(client, storage); |
1445
e29bc94711e2
Some fixes to get read-only mboxes working.
Timo Sirainen <tss@iki.fi>
parents:
1212
diff
changeset
|
22 } |
559
c834e77b624c
Mostly mbox locking/syncing fixes. Still some problems though.
Timo Sirainen <tss@iki.fi>
parents:
450
diff
changeset
|
23 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1654
diff
changeset
|
24 if (mailbox_close(mailbox) < 0) |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1654
diff
changeset
|
25 client_send_untagged_storage_error(client, storage); |
0 | 26 |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2676
diff
changeset
|
27 client_send_tagline(cmd, "OK Close completed."); |
0 | 28 return TRUE; |
29 } |