mirror of https://github.com/oxen-io/session-ios
Fixed a large number of bugs and added a setting to control open group message deletion
Added a setting to control whether open group messages older than 6 months should be pruned Added some defensive coding to prevent an edge-case which could cause a crash (wasn't filtering out a potential invalid row from the home screen data) Fixed a bug where preOffer call messages weren't correctly sending push notifications Fixed a bug where all incoming calls would be rejected and seen as calls disabled Fixed a bug where the copy on call info messages was displaying the sender's name instead of the thread contact's name for outgoing calls Fixed a bug where the input view wouldn't appear when creating new DM conversations Fixed a bug where threads might not show the message request approval UI Fixed an issue where some logic might not have run correctly when first registering an account Fixed a bug where the note to self thread could incorrectly appear when restoring a device Updated the GarbageCollectionJob to run onActive instead of onLaunch (since it's likely we will rarely launch) Updated the logic for erasing an account from a devicepull/612/head
parent
76f7e4e246
commit
c7e8071dd1
@ -0,0 +1,63 @@
|
||||
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
||||
|
||||
import UIKit
|
||||
import SessionUIKit
|
||||
import SignalUtilitiesKit
|
||||
|
||||
// FIXME: Refactor to be MVVM and use database observation
|
||||
class ChatSettingsViewController: OWSTableViewController {
|
||||
// MARK: - Lifecycle
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.updateTableContents()
|
||||
|
||||
ViewControllerUtilities.setUpDefaultSessionStyle(for: self, title: "CHATS_TITLE".localized(), hasCustomBackButton: false)
|
||||
|
||||
let closeButton: UIBarButtonItem = UIBarButtonItem(image: UIImage(named: "X"), style: .plain, target: self, action: #selector(close(_:)))
|
||||
self.navigationItem.leftBarButtonItem = closeButton
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
self.updateTableContents()
|
||||
}
|
||||
|
||||
// MARK: - Table Contents
|
||||
|
||||
func updateTableContents() {
|
||||
let updatedContents: OWSTableContents = OWSTableContents()
|
||||
|
||||
let messageTrimming: OWSTableSection = OWSTableSection()
|
||||
messageTrimming.headerTitle = "MESSAGE_TRIMMING_TITLE".localized()
|
||||
messageTrimming.footerTitle = "MESSAGE_TRIMMING_OPEN_GROUP_DESCRIPTION".localized()
|
||||
messageTrimming.add(OWSTableItem.switch(
|
||||
withText: "MESSAGE_TRIMMING_OPEN_GROUP_TITLE".localized(),
|
||||
isOn: { GRDBStorage.shared[.trimOpenGroupMessagesOlderThanSixMonths] },
|
||||
target: self,
|
||||
selector: #selector(didToggleTrimOpenGroupsSwitch(_:))
|
||||
))
|
||||
updatedContents.addSection(messageTrimming)
|
||||
|
||||
self.contents = updatedContents
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@objc private func didToggleTrimOpenGroupsSwitch(_ sender: UISwitch) {
|
||||
GRDBStorage.shared.writeAsync(
|
||||
updates: { db in
|
||||
db[.trimOpenGroupMessagesOlderThanSixMonths] = !sender.isOn
|
||||
},
|
||||
completion: { [weak self] _, _ in
|
||||
self?.updateTableContents()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@objc private func close(_ sender: UIBarButtonItem) {
|
||||
self.navigationController?.dismiss(animated: true)
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
|
||||
public extension Notification.Name {
|
||||
static let resetStorage = Notification.Name("resetStorage")
|
||||
}
|
||||
|
||||
@objc public extension NSNotification {
|
||||
@objc static let resetStorage = Notification.Name.resetStorage.rawValue as NSString
|
||||
}
|
Loading…
Reference in New Issue