Browse Source

Merge pull request #919 from deltachat/disappearing-not-experimental

make 'disappearing messages' a standard-feature
cyBerta 4 years ago
parent
commit
b02698584c

+ 1 - 5
deltachat-ios/Controller/GroupChatDetailViewController.swift

@@ -24,11 +24,7 @@ class GroupChatDetailViewController: UIViewController {
     }
 
     private lazy var chatOptions: [ChatOption] = {
-        var options: [ChatOption] = [.gallery, .documents, .muteChat]
-        if UserDefaults.standard.bool(forKey: "ephemeral_messages") || dcContext.getChatEphemeralTimer(chatId: chatId) > 0 {
-            options.insert(.ephemeralMessages, at: 2)
-        }
-        return options
+        return [.gallery, .documents, .ephemeralMessages, .muteChat]
     }()
 
     private lazy var chatActions: [ChatAction] = {

+ 0 - 15
deltachat-ios/Controller/SettingsController.swift

@@ -399,21 +399,6 @@ internal final class SettingsViewController: UITableViewController, ProgressAler
             }
         }))
 
-        let ephemeralMessages = UserDefaults.standard.bool(forKey: "ephemeral_messages")
-        let ephemeralTitle = ephemeralMessages ?
-            "Disable disappearing messages options" : "Enable disappearing messages options"
-        alert.addAction(UIAlertAction(title: ephemeralTitle, style: .default, handler: { [weak self] _ in
-            UserDefaults.standard.set(!ephemeralMessages, forKey: "ephemeral_messages")
-            if !ephemeralMessages {
-                let alert = UIAlertController(title: "Thanks for trying out the experimental feature 🧪 \"Disappearing messages\"",
-                                              message: "You will find a corresponding option in each chat profile now.\n\n"
-                                                + "If you want to quit the experimental feature, you can disable it at \"Settings / Advanced\".",
-                                              preferredStyle: .alert)
-                alert.addAction(UIAlertAction(title: String.localized("ok"), style: .default, handler: nil))
-                self?.navigationController?.present(alert, animated: true, completion: nil)
-            }
-        }))
-
         let logAction = UIAlertAction(title: String.localized("pref_view_log"), style: .default, handler: { [weak self] _ in
             self?.showDebugToolkit()
         })

+ 1 - 4
deltachat-ios/ViewModel/ContactDetailViewModel.swift

@@ -50,11 +50,8 @@ class ContactDetailViewModel {
         sections.append(.chatActions)
 
         if chatId != 0 {
-            chatOptions = [.gallery, .documents, .muteChat, .startChat]
+            chatOptions = [.gallery, .documents, .ephemeralMessages, .muteChat, .startChat]
             chatActions = [.archiveChat, .blockContact, .deleteChat]
-            if UserDefaults.standard.bool(forKey: "ephemeral_messages") || dcContext.getChatEphemeralTimer(chatId: chatId) > 0 {
-                chatOptions.insert(.ephemeralMessages, at: 2)
-            }
         } else {
             chatOptions = [.gallery, .documents, .startChat]
             chatActions = [.blockContact]