Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/imap/cmd-close.c @ 7086:7ed926ed7aa4 HEAD
Updated copyright notices to include year 2008.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 01 Jan 2008 22:05:21 +0200 |
parents | 81f4c9689c18 |
children | d76c54e092f5 |
rev | line source |
---|---|
7086
7ed926ed7aa4
Updated copyright notices to include year 2008.
Timo Sirainen <tss@iki.fi>
parents:
7057
diff
changeset
|
1 /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ |
0 | 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 |
4470
c22b5134455a
Don't try to expunge messages if the mailbox is read-only. It'll just cause
Timo Sirainen <tss@iki.fi>
parents:
3879
diff
changeset
|
19 if (!imap_expunge(mailbox, NULL)) |
c22b5134455a
Don't try to expunge messages if the mailbox is read-only. It'll just cause
Timo Sirainen <tss@iki.fi>
parents:
3879
diff
changeset
|
20 client_send_untagged_storage_error(client, storage); |
559
c834e77b624c
Mostly mbox locking/syncing fixes. Still some problems though.
Timo Sirainen <tss@iki.fi>
parents:
450
diff
changeset
|
21 |
3879
928229f8b3e6
deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
22 if (mailbox_close(&mailbox) < 0) |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1654
diff
changeset
|
23 client_send_untagged_storage_error(client, storage); |
7057
81f4c9689c18
FLAGS/PERMENENTFLAGS weren't always sent to client early enough. Also
Timo Sirainen <tss@iki.fi>
parents:
6429
diff
changeset
|
24 client_update_mailbox_flags(client, NULL); |
0 | 25 |
3141
61abed5f7864
Moved command-specific variables from struct client to struct
Timo Sirainen <tss@iki.fi>
parents:
2676
diff
changeset
|
26 client_send_tagline(cmd, "OK Close completed."); |
0 | 27 return TRUE; |
28 } |