Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
"this method is unnecessary and shouldn't be used"
  • Loading branch information
zeitschlag committed Aug 9, 2024
1 parent 1b17000 commit f7bd518
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions DcCore/DcCore/DC/events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class DcEventHandler {

case DC_EVENT_CONFIGURE_PROGRESS:
logger.info("📡[\(accountId)] configure: \(Int(data1))")

let done = Int(data1) == 1000
let done = Int(data1) == 1000

NotificationCenter.default.post(name: Event.configurationProgress, object: nil, userInfo: [
"progress": Int(data1),
Expand All @@ -70,7 +70,7 @@ public class DcEventHandler {
UserDefaults.standard.set(true, forKey: Constants.Keys.deltachatUserProvidedCredentialsKey)
UserDefaults.standard.synchronize()
}

case DC_EVENT_IMEX_PROGRESS:

NotificationCenter.default.post(name: Event.importExportProgress, object: nil, userInfo: [
Expand Down
3 changes: 0 additions & 3 deletions deltachat-ios/Controller/FullMessageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,13 @@ class FullMessageViewController: WebViewViewController {

@objc func alwaysActionPressed(_ action: UIAlertAction) {
UserDefaults.standard.set(true, forKey: "html_load_remote_content")
UserDefaults.standard.synchronize()
loadContentOnce = false
loadUnrestricedHtml()
}

@objc func onceActionPressed(_ action: UIAlertAction) {
if !isHalfBlocked {
UserDefaults.standard.set(false, forKey: "html_load_remote_content")
UserDefaults.standard.synchronize()
}
loadContentOnce = true
loadUnrestricedHtml()
Expand All @@ -112,7 +110,6 @@ class FullMessageViewController: WebViewViewController {
@objc func neverActionPressed(_ action: UIAlertAction) {
if !isHalfBlocked {
UserDefaults.standard.set(false, forKey: "html_load_remote_content")
UserDefaults.standard.synchronize()
}
loadContentOnce = false
loadRestrictedHtml()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class BackgroundOptionsViewController: UIViewController, MediaPickerDelegate {
@objc private func onDefaultSelected() {
setDefault(backgroundContainer)
UserDefaults.standard.set(nil, forKey: Constants.Keys.backgroundImageName)
UserDefaults.standard.synchronize()
}

private func setDefault(_ imageView: UIImageView) {
Expand All @@ -156,7 +155,6 @@ class BackgroundOptionsViewController: UIViewController, MediaPickerDelegate {
func onImageSelected(image: UIImage) {
if let path = ImageFormat.saveImage(image: image, name: Constants.backgroundImageName) {
UserDefaults.standard.set(URL(fileURLWithPath: path).lastPathComponent, forKey: Constants.Keys.backgroundImageName)
UserDefaults.standard.synchronize()
backgroundContainer.sd_setImage(with: URL(fileURLWithPath: path), placeholderImage: nil, options: .refreshCached, completed: nil)
} else {
logger.error("failed to save background image")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ internal final class SettingsViewController: UITableViewController {
} else {
NotificationManager.removeAllNotifications()
}
UserDefaults.standard.synchronize()

NotificationManager.updateBadgeCounters()
NotificationCenter.default.post(name: Event.messagesChanged, object: nil, userInfo: ["message_id": Int(0), "chat_id": Int(0)])
}
Expand Down

0 comments on commit f7bd518

Please sign in to comment.