|
|
|
@ -134,13 +134,24 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
[UIAlertAction actionWithTitle:NSLocalizedString(@"SETTINGS_DELETE_HISTORYLOG_CONFIRMATION_BUTTON", @"")
|
|
|
|
|
style:UIAlertActionStyleDestructive
|
|
|
|
|
handler:^(UIAlertAction *_Nonnull action) {
|
|
|
|
|
[[TSStorageManager sharedManager] deleteThreadsAndMessages];
|
|
|
|
|
[self deleteThreadsAndMessages];
|
|
|
|
|
}];
|
|
|
|
|
[alertController addAction:deleteAction];
|
|
|
|
|
|
|
|
|
|
[self presentViewController:alertController animated:true completion:nil];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)deleteThreadsAndMessages
|
|
|
|
|
{
|
|
|
|
|
[TSStorageManager.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
|
[transaction removeAllObjectsInCollection:[TSThread collection]];
|
|
|
|
|
[transaction removeAllObjectsInCollection:[SignalRecipient collection]];
|
|
|
|
|
[transaction removeAllObjectsInCollection:[TSInteraction collection]];
|
|
|
|
|
[transaction removeAllObjectsInCollection:[TSAttachment collection]];
|
|
|
|
|
}];
|
|
|
|
|
[TSAttachmentStream deleteAttachments];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)didToggleScreenSecuritySwitch:(UISwitch *)sender
|
|
|
|
|
{
|
|
|
|
|
BOOL enabled = sender.isOn;
|
|
|
|
|