Эх сурвалжийг харах

fetch only mvbox (#1456)

* appearantly dcAccounts.stopIo needs to be called before changing mvbox_move

* implement only fetch from DeltaChat folder

* disable user interaction for mvboxMoveCell cell if watchMvboxCell is enabled

* fetch add default strings from transifex

* revert changing section title

* do not disable mvbox_move when only_watch_mvbox is enabled

* sync names only_fetch_mvbox and onlyFetchMvboxCell

Co-authored-by: B. Petersen <r10s@b44t.com>
cyBerta 3 жил өмнө
parent
commit
9199020009

+ 16 - 2
deltachat-ios/Controller/AccountSetupController.swift

@@ -63,7 +63,7 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
         certCheckCell,
         viewLogCell
     ]
-    private lazy var folderCells: [UITableViewCell] = [sentboxWatchCell, sendCopyToSelfCell, mvboxMoveCell]
+    private lazy var folderCells: [UITableViewCell] = [sentboxWatchCell, sendCopyToSelfCell, mvboxMoveCell, onlyFetchMvboxCell]
     private let editView: Bool
     private var advancedSectionShowing: Bool = false
     private var providerInfoShowing: Bool = false
@@ -288,10 +288,24 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
             textLabel: String.localized("pref_auto_folder_moves"),
             on: dcContext.getConfigBool("mvbox_move"),
             action: { cell in
+                self.dcAccounts.stopIo()
                 self.dcContext.setConfigBool("mvbox_move", cell.isOn)
+                self.dcAccounts.startIo()
+        })
+    }()
+
+    lazy var onlyFetchMvboxCell: SwitchCell = {
+        return SwitchCell(
+            textLabel: String.localized("pref_only_fetch_mvbox_title"),
+            on: dcContext.getConfigBool("only_fetch_mvbox"),
+            action: { cell in
+                self.dcAccounts.stopIo()
+                self.dcContext.setConfigBool("only_fetch_mvbox", cell.isOn)
+                self.dcAccounts.startIo()
         })
     }()
 
+
     private lazy var loginButton: UIBarButtonItem = {
         let button = UIBarButtonItem(
             title: String.localized("login_title"),
@@ -415,7 +429,7 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
                 return String.localized("login_subheader")
             }
         } else if sections[section] == folderSection {
-            return String.localized("pref_auto_folder_moves_explain")
+            return String.localized("pref_only_fetch_mvbox_explain")
         } else {
             return nil
         }

+ 2 - 0
deltachat-ios/en.lproj/Localizable.strings

@@ -549,6 +549,8 @@
 "pref_send_copy_to_self" = "Send Copy to Self";
 "pref_auto_folder_moves" = "Automatic Moves to DeltaChat Folder";
 "pref_auto_folder_moves_explain" = "Chat conversations are moved to avoid cluttering the Inbox";
+"pref_only_fetch_mvbox_title" = "Only Fetch from DeltaChat Folder";
+"pref_only_fetch_mvbox_explain" = "Ignore other folders. Requires your server to move chat messages to the DeltaChat folder.";
 "pref_show_emails" = "Show Classic E-Mails";
 "pref_show_emails_no" = "No, chats only";
 "pref_show_emails_accepted_contacts" = "For accepted contacts";