Undelete: deleted files, calendar events, contacts and Sieve scripts are kept and restored where they were (UD-1, UD-8 to UD-11)
Files, events and contacts are noted when deleted for good and archived by the unindex task when retention is on; Sieve scripts are archived at deletion. A restore goes back to its folder, calendar or address book if it still exists, takes a free " (restored)" name, comes back inactive for scripts, and is refused over quota with the item left archived. Acceptance tests 6, 8 and 12.
This commit is contained in:
@@ -234,6 +234,15 @@ impl DestroyArchive<Archive<&ArchivedContactCard>> {
|
||||
)
|
||||
.caused_by(trc::location!())?;
|
||||
} else {
|
||||
// inbuxa: UD-1: noted for undelete
|
||||
crate::inbuxa::note_card(
|
||||
batch,
|
||||
account_id,
|
||||
document_id,
|
||||
&card
|
||||
.deserialize::<ContactCard>()
|
||||
.caused_by(trc::location!())?,
|
||||
)?;
|
||||
// Delete card
|
||||
batch
|
||||
.with_document(document_id)
|
||||
@@ -262,6 +271,16 @@ impl DestroyArchive<Archive<&ArchivedContactCard>> {
|
||||
document_id: u32,
|
||||
batch: &mut BatchBuilder,
|
||||
) -> trc::Result<()> {
|
||||
// inbuxa: UD-1: noted for undelete
|
||||
crate::inbuxa::note_card(
|
||||
batch,
|
||||
account_id,
|
||||
document_id,
|
||||
&self
|
||||
.0
|
||||
.deserialize::<ContactCard>()
|
||||
.caused_by(trc::location!())?,
|
||||
)?;
|
||||
batch
|
||||
.with_account_id(account_id)
|
||||
.with_collection(Collection::ContactCard)
|
||||
|
||||
Reference in New Issue
Block a user