Explorar el Código

Merge pull request #535 from deltachat/provider-info

add provider info
bjoern hace 5 años
padre
commit
0977e6466d

+ 9 - 1
deltachat-ios.xcodeproj/project.pbxproj

@@ -152,6 +152,8 @@
 		AEE6EC3F2282C59C00EDC689 /* GroupMembersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE6EC3E2282C59C00EDC689 /* GroupMembersViewController.swift */; };
 		AEE6EC3F2282C59C00EDC689 /* GroupMembersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE6EC3E2282C59C00EDC689 /* GroupMembersViewController.swift */; };
 		AEE6EC412282DF5700EDC689 /* MailboxViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE6EC402282DF5700EDC689 /* MailboxViewController.swift */; };
 		AEE6EC412282DF5700EDC689 /* MailboxViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE6EC402282DF5700EDC689 /* MailboxViewController.swift */; };
 		AEE6EC482283045D00EDC689 /* EditSettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE6EC472283045D00EDC689 /* EditSettingsController.swift */; };
 		AEE6EC482283045D00EDC689 /* EditSettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE6EC472283045D00EDC689 /* EditSettingsController.swift */; };
+		AEFBE22F23FEF23D0045327A /* ProviderInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEFBE22E23FEF23D0045327A /* ProviderInfoCell.swift */; };
+		AEFBE23123FF09B20045327A /* TypeAlias.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEFBE23023FF09B20045327A /* TypeAlias.swift */; };
 		B21005DB23383664004C70C5 /* SettingsClassicViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B21005DA23383664004C70C5 /* SettingsClassicViewController.swift */; };
 		B21005DB23383664004C70C5 /* SettingsClassicViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B21005DA23383664004C70C5 /* SettingsClassicViewController.swift */; };
 		B26B3BC7236DC3DC008ED35A /* SwitchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26B3BC6236DC3DC008ED35A /* SwitchCell.swift */; };
 		B26B3BC7236DC3DC008ED35A /* SwitchCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26B3BC6236DC3DC008ED35A /* SwitchCell.swift */; };
 /* End PBXBuildFile section */
 /* End PBXBuildFile section */
@@ -350,7 +352,7 @@
 		AE19887423EB264000B4CD5F /* HelpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpViewController.swift; sourceTree = "<group>"; };
 		AE19887423EB264000B4CD5F /* HelpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpViewController.swift; sourceTree = "<group>"; };
 		AE1988A423EB2FBA00B4CD5F /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = "<group>"; };
 		AE1988A423EB2FBA00B4CD5F /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = "<group>"; };
 		AE1988A623EB382A00B4CD5F /* Help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Help; sourceTree = "<group>"; };
 		AE1988A623EB382A00B4CD5F /* Help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Help; sourceTree = "<group>"; };
-		AE1988AA23EB3C7600B4CD5F /* Assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Assets; path = Assets; sourceTree = "<group>"; };
+		AE1988AA23EB3C7600B4CD5F /* Assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Assets; sourceTree = "<group>"; };
 		AE25F08F22807AD800CDEA66 /* AvatarSelectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvatarSelectionCell.swift; sourceTree = "<group>"; };
 		AE25F08F22807AD800CDEA66 /* AvatarSelectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvatarSelectionCell.swift; sourceTree = "<group>"; };
 		AE38B31722672DFC00EC37A1 /* ActionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCell.swift; sourceTree = "<group>"; };
 		AE38B31722672DFC00EC37A1 /* ActionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCell.swift; sourceTree = "<group>"; };
 		AE38B3192267328200EC37A1 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = "<group>"; };
 		AE38B3192267328200EC37A1 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = "<group>"; };
@@ -381,6 +383,8 @@
 		AEE6EC3E2282C59C00EDC689 /* GroupMembersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupMembersViewController.swift; sourceTree = "<group>"; };
 		AEE6EC3E2282C59C00EDC689 /* GroupMembersViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupMembersViewController.swift; sourceTree = "<group>"; };
 		AEE6EC402282DF5700EDC689 /* MailboxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailboxViewController.swift; sourceTree = "<group>"; };
 		AEE6EC402282DF5700EDC689 /* MailboxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailboxViewController.swift; sourceTree = "<group>"; };
 		AEE6EC472283045D00EDC689 /* EditSettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditSettingsController.swift; sourceTree = "<group>"; };
 		AEE6EC472283045D00EDC689 /* EditSettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditSettingsController.swift; sourceTree = "<group>"; };
+		AEFBE22E23FEF23D0045327A /* ProviderInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProviderInfoCell.swift; sourceTree = "<group>"; };
+		AEFBE23023FF09B20045327A /* TypeAlias.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeAlias.swift; sourceTree = "<group>"; };
 		B21005DA23383664004C70C5 /* SettingsClassicViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsClassicViewController.swift; sourceTree = "<group>"; };
 		B21005DA23383664004C70C5 /* SettingsClassicViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsClassicViewController.swift; sourceTree = "<group>"; };
 		B253ED992336E759004DD215 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		B253ED992336E759004DD215 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		B253ED9A2336E759004DD215 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
 		B253ED9A2336E759004DD215 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -764,6 +768,7 @@
 				30AC265E237F1807002A943F /* AvatarHelper.swift */,
 				30AC265E237F1807002A943F /* AvatarHelper.swift */,
 				302B84C42396627F001C261F /* RelayHelper.swift */,
 				302B84C42396627F001C261F /* RelayHelper.swift */,
 				AE1988A423EB2FBA00B4CD5F /* Errors.swift */,
 				AE1988A423EB2FBA00B4CD5F /* Errors.swift */,
+				AEFBE23023FF09B20045327A /* TypeAlias.swift */,
 			);
 			);
 			path = Helper;
 			path = Helper;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -787,6 +792,7 @@
 				AE9DAF0E22C278C6004C9591 /* ChatTitleView.swift */,
 				AE9DAF0E22C278C6004C9591 /* ChatTitleView.swift */,
 				30F9B9EB235F2116006E7ACF /* MessageCounter.swift */,
 				30F9B9EB235F2116006E7ACF /* MessageCounter.swift */,
 				305FE03523A81B4C0053BE90 /* PaddingLabel.swift */,
 				305FE03523A81B4C0053BE90 /* PaddingLabel.swift */,
+				AEFBE22E23FEF23D0045327A /* ProviderInfoCell.swift */,
 			);
 			);
 			path = View;
 			path = View;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1154,6 +1160,7 @@
 				305962072346125100C80F33 /* MessagesCollectionViewFlowLayout.swift in Sources */,
 				305962072346125100C80F33 /* MessagesCollectionViewFlowLayout.swift in Sources */,
 				78ED838321D5379000243125 /* TextFieldCell.swift in Sources */,
 				78ED838321D5379000243125 /* TextFieldCell.swift in Sources */,
 				78E45E3C21D3D03700D4B15E /* TextFieldTableViewCell.swift in Sources */,
 				78E45E3C21D3D03700D4B15E /* TextFieldTableViewCell.swift in Sources */,
+				AEFBE23123FF09B20045327A /* TypeAlias.swift in Sources */,
 				AE19887523EB264000B4CD5F /* HelpViewController.swift in Sources */,
 				AE19887523EB264000B4CD5F /* HelpViewController.swift in Sources */,
 				305961D52346125100C80F33 /* MessagesViewController+Menu.swift in Sources */,
 				305961D52346125100C80F33 /* MessagesViewController+Menu.swift in Sources */,
 				305961F22346125100C80F33 /* LocationMessageCell.swift in Sources */,
 				305961F22346125100C80F33 /* LocationMessageCell.swift in Sources */,
@@ -1185,6 +1192,7 @@
 				AE1988A523EB2FBA00B4CD5F /* Errors.swift in Sources */,
 				AE1988A523EB2FBA00B4CD5F /* Errors.swift in Sources */,
 				305961DD2346125100C80F33 /* SenderType.swift in Sources */,
 				305961DD2346125100C80F33 /* SenderType.swift in Sources */,
 				305961E32346125100C80F33 /* MessagesDataSource.swift in Sources */,
 				305961E32346125100C80F33 /* MessagesDataSource.swift in Sources */,
+				AEFBE22F23FEF23D0045327A /* ProviderInfoCell.swift in Sources */,
 				305961E22346125100C80F33 /* MessagesDisplayDelegate.swift in Sources */,
 				305961E22346125100C80F33 /* MessagesDisplayDelegate.swift in Sources */,
 				305962092346125100C80F33 /* AudioMessageSizeCalculator.swift in Sources */,
 				305962092346125100C80F33 /* AudioMessageSizeCalculator.swift in Sources */,
 				305961DB2346125100C80F33 /* AudioItem.swift in Sources */,
 				305961DB2346125100C80F33 /* AudioItem.swift in Sources */,

+ 171 - 84
deltachat-ios/Controller/AccountSetupController.swift

@@ -62,17 +62,21 @@ class AccountSetupController: UITableViewController {
     ]
     ]
     private lazy var folderCells: [UITableViewCell] = [inboxWatchCell, sentboxWatchCell, mvboxWatchCell, sendCopyToSelfCell, mvboxMoveCell]
     private lazy var folderCells: [UITableViewCell] = [inboxWatchCell, sentboxWatchCell, mvboxWatchCell, sendCopyToSelfCell, mvboxMoveCell]
     private lazy var dangerCells: [UITableViewCell] = [emptyServerCell, deleteAccountCell]
     private lazy var dangerCells: [UITableViewCell] = [emptyServerCell, deleteAccountCell]
-
     private let editView: Bool
     private let editView: Bool
     private var advancedSectionShowing: Bool = false
     private var advancedSectionShowing: Bool = false
+    private var providerInfoShowing: Bool = false
 
 
+    private var provider: DcProvider?
 
 
-    // the progress dialog
+    // MARK: - the progress dialog
 
 
     private lazy var configProgressAlert: UIAlertController = {
     private lazy var configProgressAlert: UIAlertController = {
         let alert = UIAlertController(title: "", message: "", preferredStyle: .alert)
         let alert = UIAlertController(title: "", message: "", preferredStyle: .alert)
-        alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: { _ in
-            self.dcContext.stopOngoingProcess()
+        alert.addAction(UIAlertAction(
+            title: String.localized("cancel"),
+            style: .cancel,
+            handler: { _ in
+                self.dcContext.stopOngoingProcess()
         }))
         }))
         return alert
         return alert
     }()
     }()
@@ -108,11 +112,12 @@ class AccountSetupController: UITableViewController {
         }
         }
     }
     }
 
 
-    // cells
+    // MARK: - cells
 
 
     private lazy var emailCell: TextFieldCell = {
     private lazy var emailCell: TextFieldCell = {
         let cell = TextFieldCell.makeEmailCell(delegate: self)
         let cell = TextFieldCell.makeEmailCell(delegate: self)
         cell.tag = tagEmailCell
         cell.tag = tagEmailCell
+        cell.textField.addTarget(self, action: #selector(emailCellEdited), for: .editingChanged)
         cell.textField.tag = tagTextFieldEmail // will be used to eventually show oAuth-Dialogue when pressing return key
         cell.textField.tag = tagTextFieldEmail // will be used to eventually show oAuth-Dialogue when pressing return key
         cell.setText(text: DcConfig.addr ?? nil)
         cell.setText(text: DcConfig.addr ?? nil)
         cell.textField.delegate = self
         cell.textField.delegate = self
@@ -130,6 +135,15 @@ class AccountSetupController: UITableViewController {
         return cell
         return cell
     }()
     }()
 
 
+    private lazy var providerInfoCell: ProviderInfoCell = {
+        let cell = ProviderInfoCell()
+        cell.onInfoButtonPressed = {
+            [unowned self] in
+            self.handleProviderInfoButton()
+        }
+        return cell
+    }()
+
     private lazy var restoreCell: UITableViewCell = {
     private lazy var restoreCell: UITableViewCell = {
         let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
         let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
         cell.textLabel?.text = String.localized("import_backup_title")
         cell.textLabel?.text = String.localized("import_backup_title")
@@ -163,9 +177,10 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var imapServerCell: TextFieldCell = {
     lazy var imapServerCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_imap_server",
-                                 placeholder: String.localized("automatic"),
-                                 delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_imap_server",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.tag = tagImapServerCell
         cell.tag = tagImapServerCell
         cell.setText(text: DcConfig.mailServer ?? nil)
         cell.setText(text: DcConfig.mailServer ?? nil)
         cell.textField.tag = tagTextFieldImapServer
         cell.textField.tag = tagTextFieldImapServer
@@ -176,7 +191,10 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var imapUserCell: TextFieldCell = {
     lazy var imapUserCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_imap_login", placeholder: String.localized("automatic"), delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_imap_login",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.setText(text: DcConfig.mailUser ?? nil)
         cell.setText(text: DcConfig.mailUser ?? nil)
         cell.textField.tag = tagTextFieldImapLogin
         cell.textField.tag = tagTextFieldImapLogin
         cell.tag = tagImapUserCell
         cell.tag = tagImapUserCell
@@ -195,9 +213,10 @@ class AccountSetupController: UITableViewController {
     }
     }
 
 
     lazy var imapPortCell: TextFieldCell = {
     lazy var imapPortCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_imap_port",
-                                 placeholder: String.localized("automatic"),
-                                 delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_imap_port",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.tag = tagImapPortCell
         cell.tag = tagImapPortCell
         cell.setText(text: editablePort(port: DcConfig.mailPort))
         cell.setText(text: editablePort(port: DcConfig.mailPort))
         cell.textField.tag = tagImapPortCell
         cell.textField.tag = tagImapPortCell
@@ -217,9 +236,10 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var smtpServerCell: TextFieldCell = {
     lazy var smtpServerCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_smtp_server",
-                                 placeholder: String.localized("automatic"),
-                                 delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_smtp_server",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.textField.tag = tagTextFieldSmtpServer
         cell.textField.tag = tagTextFieldSmtpServer
         cell.setText(text: DcConfig.sendServer ?? nil)
         cell.setText(text: DcConfig.sendServer ?? nil)
         cell.tag = tagSmtpServerCell
         cell.tag = tagSmtpServerCell
@@ -230,7 +250,10 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var smtpUserCell: TextFieldCell = {
     lazy var smtpUserCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_smtp_login", placeholder: String.localized("automatic"), delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_smtp_login",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.textField.tag = tagTextFieldSmtpUser
         cell.textField.tag = tagTextFieldSmtpUser
         cell.setText(text: DcConfig.sendUser ?? nil)
         cell.setText(text: DcConfig.sendUser ?? nil)
         cell.tag = tagSmtpUserCell
         cell.tag = tagSmtpUserCell
@@ -238,9 +261,10 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var smtpPortCell: TextFieldCell = {
     lazy var smtpPortCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_smtp_port",
-                                 placeholder: String.localized("automatic"),
-                                 delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_smtp_port",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.tag = tagSmtpPortCell
         cell.tag = tagSmtpPortCell
         cell.setText(text: editablePort(port: DcConfig.sendPort))
         cell.setText(text: editablePort(port: DcConfig.sendPort))
         cell.textField.tag = tagSmtpPortCell
         cell.textField.tag = tagSmtpPortCell
@@ -249,7 +273,10 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var smtpPasswordCell: TextFieldCell = {
     lazy var smtpPasswordCell: TextFieldCell = {
-        let cell = TextFieldCell(descriptionID: "login_smtp_password", placeholder: String.localized("automatic"), delegate: self)
+        let cell = TextFieldCell(
+            descriptionID: "login_smtp_password",
+            placeholder: String.localized("automatic"),
+            delegate: self)
         cell.textField.textContentType = UITextContentType.password
         cell.textField.textContentType = UITextContentType.password
         cell.setText(text: DcConfig.sendPw ?? nil)
         cell.setText(text: DcConfig.sendPw ?? nil)
         cell.textField.isSecureTextEntry = true
         cell.textField.isSecureTextEntry = true
@@ -281,51 +308,61 @@ class AccountSetupController: UITableViewController {
     }()
     }()
 
 
     lazy var inboxWatchCell: SwitchCell = {
     lazy var inboxWatchCell: SwitchCell = {
-        return SwitchCell(textLabel: String.localized("pref_watch_inbox_folder"),
-                          on: dcContext.getConfigBool("inbox_watch"),
-                          action: { cell in
-                              self.dcContext.setConfigBool("inbox_watch", cell.isOn)
-                          })
+        return SwitchCell(
+            textLabel: String.localized("pref_watch_inbox_folder"),
+            on: dcContext.getConfigBool("inbox_watch"),
+            action: { cell in
+                self.dcContext.setConfigBool("inbox_watch", cell.isOn)
+        })
     }()
     }()
 
 
     lazy var sentboxWatchCell: SwitchCell = {
     lazy var sentboxWatchCell: SwitchCell = {
-        return SwitchCell(textLabel: String.localized("pref_watch_sent_folder"),
-                          on: dcContext.getConfigBool("sentbox_watch"),
-                          action: { cell in
-                              self.dcContext.setConfigBool("sentbox_watch", cell.isOn)
-                          })
+        return SwitchCell(
+            textLabel: String.localized("pref_watch_sent_folder"),
+            on: dcContext.getConfigBool("sentbox_watch"),
+            action: { cell in
+                self.dcContext.setConfigBool("sentbox_watch", cell.isOn)
+        })
     }()
     }()
 
 
     lazy var mvboxWatchCell: SwitchCell = {
     lazy var mvboxWatchCell: SwitchCell = {
-        return SwitchCell(textLabel: String.localized("pref_watch_mvbox_folder"),
-                          on: dcContext.getConfigBool("mvbox_watch"),
-                          action: { cell in
-                              self.dcContext.setConfigBool("mvbox_watch", cell.isOn)
-                          })
+        return SwitchCell(
+            textLabel: String.localized("pref_watch_mvbox_folder"),
+            on: dcContext.getConfigBool("mvbox_watch"),
+            action: { cell in
+                self.dcContext.setConfigBool("mvbox_watch", cell.isOn)
+        })
     }()
     }()
 
 
     lazy var sendCopyToSelfCell: SwitchCell = {
     lazy var sendCopyToSelfCell: SwitchCell = {
-        return SwitchCell(textLabel: String.localized("pref_send_copy_to_self"),
-                          on: dcContext.getConfigBool("bcc_self"),
-                          action: { cell in
-                              self.dcContext.setConfigBool("bcc_self", cell.isOn)
-                          })
+        return SwitchCell(
+            textLabel: String.localized("pref_send_copy_to_self"),
+            on: dcContext.getConfigBool("bcc_self"),
+            action: { cell in
+                self.dcContext.setConfigBool("bcc_self", cell.isOn)
+        })
     }()
     }()
 
 
     lazy var mvboxMoveCell: SwitchCell = {
     lazy var mvboxMoveCell: SwitchCell = {
-        return SwitchCell(textLabel: String.localized("pref_auto_folder_moves"),
-                          on: dcContext.getConfigBool("mvbox_move"),
-                          action: { cell in
-                              self.dcContext.setConfigBool("mvbox_move", cell.isOn)
-                          })
+        return SwitchCell(
+            textLabel: String.localized("pref_auto_folder_moves"),
+            on: dcContext.getConfigBool("mvbox_move"),
+            action: { cell in
+                self.dcContext.setConfigBool("mvbox_move", cell.isOn)
+        })
     }()
     }()
 
 
     private lazy var loginButton: UIBarButtonItem = {
     private lazy var loginButton: UIBarButtonItem = {
-        let button = UIBarButtonItem(title: String.localized("login_title"), style: .done, target: self, action: #selector(loginButtonPressed))
+        let button = UIBarButtonItem(
+            title: String.localized("login_title"),
+            style: .done,
+            target: self,
+            action: #selector(loginButtonPressed))
         button.isEnabled = dc_is_configured(mailboxPointer) == 0
         button.isEnabled = dc_is_configured(mailboxPointer) == 0
         return button
         return button
     }()
     }()
 
 
+    // MARK: - constructor
     init(dcContext: DcContext, editView: Bool) {
     init(dcContext: DcContext, editView: Bool) {
         self.editView = editView
         self.editView = editView
         self.dcContext = dcContext
         self.dcContext = dcContext
@@ -347,6 +384,7 @@ class AccountSetupController: UITableViewController {
         fatalError("init(coder:) has not been implemented")
         fatalError("init(coder:) has not been implemented")
     }
     }
 
 
+    // MARK: - lifecycle
     override func viewDidLoad() {
     override func viewDidLoad() {
         super.viewDidLoad()
         super.viewDidLoad()
         if editView {
         if editView {
@@ -386,7 +424,6 @@ class AccountSetupController: UITableViewController {
     }
     }
 
 
     // MARK: - Table view data source
     // MARK: - Table view data source
-
     override func numberOfSections(in _: UITableView) -> Int {
     override func numberOfSections(in _: UITableView) -> Int {
         return sections.count
         return sections.count
     }
     }
@@ -493,6 +530,7 @@ class AccountSetupController: UITableViewController {
         }
         }
     }
     }
 
 
+    // MARK: - actions
     private func toggleAdvancedSection() {
     private func toggleAdvancedSection() {
         let willShow = !advancedSectionShowing
         let willShow = !advancedSectionShowing
 
 
@@ -532,6 +570,36 @@ class AccountSetupController: UITableViewController {
         login(emailAddress: emailAddress, password: password)
         login(emailAddress: emailAddress, password: password)
     }
     }
 
 
+    func updateProviderInfo() {
+            provider = dcContext.getProviderFromEmail(addr: emailCell.getText() ?? "")
+        if let hint = provider?.beforeLoginHint,
+            let status = provider?.status,
+            let statusType = ProviderInfoStatus(rawValue: status),
+            !hint.isEmpty {
+            providerInfoCell.updateInfo(hint: hint, hintType: statusType)
+            if !providerInfoShowing {
+                showProviderInfo()
+            }
+        } else if providerInfoShowing {
+            hideProviderInfo()
+        }
+    }
+
+    func showProviderInfo() {
+        basicSectionCells = [emailCell, passwordCell, providerInfoCell]
+        let providerInfoCellIndexPath = IndexPath(row: 2, section: 0)
+        tableView.insertRows(at: [providerInfoCellIndexPath], with: .fade)
+        providerInfoShowing = true
+    }
+
+    func hideProviderInfo() {
+        providerInfoCell.updateInfo(hint: nil, hintType: .none)
+        basicSectionCells = [emailCell, passwordCell]
+        let providerInfoCellIndexPath = IndexPath(row: 2, section: 0)
+        tableView.deleteRows(at: [providerInfoCellIndexPath], with: .automatic)
+        providerInfoShowing = false
+    }
+
     private func login(emailAddress: String, password: String, skipAdvanceSetup: Bool = false) {
     private func login(emailAddress: String, password: String, skipAdvanceSetup: Bool = false) {
         addProgressHudLoginListener()
         addProgressHudLoginListener()
         resignFirstResponderOnAllCells()	// this will resign focus from all textFieldCells so the keyboard wont pop up anymore
         resignFirstResponderOnAllCells()	// this will resign focus from all textFieldCells so the keyboard wont pop up anymore
@@ -558,43 +626,43 @@ class AccountSetupController: UITableViewController {
         // disable oauth2 for now as not yet supported by deltachat-rust.
         // disable oauth2 for now as not yet supported by deltachat-rust.
         /*
         /*
          if skipOauth {
          if skipOauth {
-         	// user has previously denied oAuth2-setup
-         	return false
+             // user has previously denied oAuth2-setup
+             return false
          }
          }
 
 
          guard let oAuth2UrlPointer = dc_get_oauth2_url(mailboxPointer, emailAddress, "chat.delta:/auth") else {
          guard let oAuth2UrlPointer = dc_get_oauth2_url(mailboxPointer, emailAddress, "chat.delta:/auth") else {
-         	//MRConfig.setAuthFlags(flags: Int(DC_LP_AUTH_NORMAL)) -- do not reset, there may be different values
-         	return false
+             //MRConfig.setAuthFlags(flags: Int(DC_LP_AUTH_NORMAL)) -- do not reset, there may be different values
+             return false
          }
          }
 
 
          let oAuth2Url = String(cString: oAuth2UrlPointer)
          let oAuth2Url = String(cString: oAuth2UrlPointer)
 
 
          if let url = URL(string: oAuth2Url) {
          if let url = URL(string: oAuth2Url) {
-         	let title = "Continue with simplified setup"
-         	// swiftlint:disable all
-         	let message = "The entered e-mail address supports a simplified setup (oAuth2).\n\nIn the next step, please allow Delta Chat to act as your Chat with E-Mail app.\n\nThere are no Delta Chat servers, your data stays on your device."
-
-         	let oAuthAlertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
-         	let confirm = UIAlertAction(title: "Confirm", style: .default, handler: {
-         		[unowned self] _ in
-         		let nc = NotificationCenter.default
-         		self.oauth2Observer = nc.addObserver(self, selector: #selector(self.oauthLoginApproved), name: NSNotification.Name("oauthLoginApproved"), object: nil)
-         		self.launchOAuthBrowserWindow(url: url)
-         	})
-         	let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: {
-         		_ in
-         		MRConfig.setAuthFlags(flags: Int(DC_LP_AUTH_NORMAL))
-         		self.skipOauth = true
-         		handleCancel?()
-
-         	})
-         	oAuthAlertController.addAction(confirm)
-         	oAuthAlertController.addAction(cancel)
-
-         	present(oAuthAlertController, animated: true, completion: nil)
-         	return true
+             let title = "Continue with simplified setup"
+             // swiftlint:disable all
+             let message = "The entered e-mail address supports a simplified setup (oAuth2).\n\nIn the next step, please allow Delta Chat to act as your Chat with E-Mail app.\n\nThere are no Delta Chat servers, your data stays on your device."
+
+             let oAuthAlertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
+             let confirm = UIAlertAction(title: "Confirm", style: .default, handler: {
+                 [unowned self] _ in
+                 let nc = NotificationCenter.default
+                 self.oauth2Observer = nc.addObserver(self, selector: #selector(self.oauthLoginApproved), name: NSNotification.Name("oauthLoginApproved"), object: nil)
+                 self.launchOAuthBrowserWindow(url: url)
+             })
+             let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: {
+                 _ in
+                 MRConfig.setAuthFlags(flags: Int(DC_LP_AUTH_NORMAL))
+                 self.skipOauth = true
+                 handleCancel?()
+
+             })
+             oAuthAlertController.addAction(confirm)
+             oAuthAlertController.addAction(cancel)
+
+             present(oAuthAlertController, animated: true, completion: nil)
+             return true
          } else {
          } else {
-         	return false
+             return false
          }
          }
          */
          */
     }
     }
@@ -695,8 +763,10 @@ class AccountSetupController: UITableViewController {
                 dc_imex(mailboxPointer, DC_IMEX_IMPORT_BACKUP, file, nil)
                 dc_imex(mailboxPointer, DC_IMEX_IMPORT_BACKUP, file, nil)
             }
             }
             else {
             else {
-                let alert = UIAlertController(title: String.localized("import_backup_title"),
-                    message: String.localizedStringWithFormat(String.localized("import_backup_no_backup_found"),
+                let alert = UIAlertController(
+                    title: String.localized("import_backup_title"),
+                    message: String.localizedStringWithFormat(
+                        String.localized("import_backup_no_backup_found"),
                         "iTunes / <Your Device> / File Sharing / Delta Chat"), // TOOD: maybe better use an iOS-specific string here
                         "iTunes / <Your Device> / File Sharing / Delta Chat"), // TOOD: maybe better use an iOS-specific string here
                     preferredStyle: .alert)
                     preferredStyle: .alert)
                 alert.addAction(UIAlertAction(title: String.localized("ok"), style: .cancel))
                 alert.addAction(UIAlertAction(title: String.localized("ok"), style: .cancel))
@@ -709,7 +779,7 @@ class AccountSetupController: UITableViewController {
 
 
     private func emptyServer() {
     private func emptyServer() {
         let alert = UIAlertController(title: String.localized("pref_empty_server_title"),
         let alert = UIAlertController(title: String.localized("pref_empty_server_title"),
-            message: String.localized("pref_empty_server_msg"), preferredStyle: .safeActionSheet)
+                                      message: String.localized("pref_empty_server_msg"), preferredStyle: .safeActionSheet)
         alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_inbox"), style: .destructive, handler: { _ in
         alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_inbox"), style: .destructive, handler: { _ in
             self.emptyServer2ndConfirm(title: String.localized("pref_empty_server_inbox"), flags: Int(DC_EMPTY_INBOX))
             self.emptyServer2ndConfirm(title: String.localized("pref_empty_server_inbox"), flags: Int(DC_EMPTY_INBOX))
         }))
         }))
@@ -721,7 +791,8 @@ class AccountSetupController: UITableViewController {
     }
     }
 
 
     private func emptyServer2ndConfirm(title: String, flags: Int) {
     private func emptyServer2ndConfirm(title: String, flags: Int) {
-        let alert = UIAlertController(title: title,
+        let alert = UIAlertController(
+            title: title,
             message: String.localized("pref_empty_server_msg"), preferredStyle: .alert)
             message: String.localized("pref_empty_server_msg"), preferredStyle: .alert)
         alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_do_button"), style: .destructive, handler: { _ in
         alert.addAction(UIAlertAction(title: String.localized("pref_empty_server_do_button"), style: .destructive, handler: { _ in
             self.dcContext.emptyServer(flags: flags)
             self.dcContext.emptyServer(flags: flags)
@@ -737,9 +808,10 @@ class AccountSetupController: UITableViewController {
 
 
         let dbfile = appDelegate.dbfile()
         let dbfile = appDelegate.dbfile()
         let dburl = URL(fileURLWithPath: dbfile, isDirectory: false)
         let dburl = URL(fileURLWithPath: dbfile, isDirectory: false)
-        let alert = UIAlertController(title: String.localized("delete_account_ask"),
-                                      message: nil,
-                                      preferredStyle: .safeActionSheet)
+        let alert = UIAlertController(
+            title: String.localized("delete_account_ask"),
+            message: nil,
+            preferredStyle: .safeActionSheet)
 
 
         alert.addAction(UIAlertAction(title: String.localized("delete_account"), style: .destructive, handler: { _ in
         alert.addAction(UIAlertAction(title: String.localized("delete_account"), style: .destructive, handler: { _ in
             appDelegate.stop()
             appDelegate.stop()
@@ -785,14 +857,20 @@ class AccountSetupController: UITableViewController {
 
 
         let _ = advancedSectionCells.map({
         let _ = advancedSectionCells.map({
             resignCell(cell: $0)
             resignCell(cell: $0)
-        }
-        )
+        })
     }
     }
 
 
     private func handleLoginButton() {
     private func handleLoginButton() {
         loginButton.isEnabled = !(emailCell.getText() ?? "").isEmpty && !(passwordCell.getText() ?? "").isEmpty
         loginButton.isEnabled = !(emailCell.getText() ?? "").isEmpty && !(passwordCell.getText() ?? "").isEmpty
     }
     }
 
 
+    private func handleProviderInfoButton() {
+        guard let provider = provider else {
+            return
+        }
+        coordinator?.openProviderInfo(provider: provider)
+    }
+
     func resignCell(cell: UITableViewCell) {
     func resignCell(cell: UITableViewCell) {
         if let c = cell as? TextFieldCell {
         if let c = cell as? TextFieldCell {
             c.textField.resignFirstResponder()
             c.textField.resignFirstResponder()
@@ -802,8 +880,16 @@ class AccountSetupController: UITableViewController {
     @objc private func textFieldDidChange() {
     @objc private func textFieldDidChange() {
         handleLoginButton()
         handleLoginButton()
     }
     }
+
+    @objc private func emailCellEdited() {
+        if providerInfoShowing {
+            updateProviderInfo()
+        }
+    }
+
 }
 }
 
 
+// MARK: -
 extension AccountSetupController: UITextFieldDelegate {
 extension AccountSetupController: UITextFieldDelegate {
     func textFieldShouldReturn(_ textField: UITextField) -> Bool {
     func textFieldShouldReturn(_ textField: UITextField) -> Bool {
         let currentTag = textField.tag
         let currentTag = textField.tag
@@ -835,6 +921,7 @@ extension AccountSetupController: UITextFieldDelegate {
             let _ = showOAuthAlertIfNeeded(emailAddress: textField.text ?? "", handleCancel: {
             let _ = showOAuthAlertIfNeeded(emailAddress: textField.text ?? "", handleCancel: {
                 self.passwordCell.textField.becomeFirstResponder()
                 self.passwordCell.textField.becomeFirstResponder()
             })
             })
+            updateProviderInfo()
         }
         }
     }
     }
 }
 }

+ 6 - 1
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -271,7 +271,7 @@ class AccountSetupCoordinator: Coordinator {
 
 
     func showImapSecurityOptions() {
     func showImapSecurityOptions() {
         let securitySettingsController = SecuritySettingsController(title: String.localized("login_imap_security"),
         let securitySettingsController = SecuritySettingsController(title: String.localized("login_imap_security"),
-                                                                    type: SecurityType.IMAPSecurity)
+                                                                      type: SecurityType.IMAPSecurity)
         navigationController.pushViewController(securitySettingsController, animated: true)
         navigationController.pushViewController(securitySettingsController, animated: true)
     }
     }
 
 
@@ -280,6 +280,11 @@ class AccountSetupCoordinator: Coordinator {
         navigationController.pushViewController(securitySettingsController, animated: true)
         navigationController.pushViewController(securitySettingsController, animated: true)
     }
     }
 
 
+    func openProviderInfo(provider: DcProvider) {
+        guard let url = URL(string: provider.getOverviewPage) else { return }
+        UIApplication.shared.open(url)
+    }
+
     func navigateBack() {
     func navigateBack() {
         navigationController.popViewController(animated: true)
         navigationController.popViewController(animated: true)
     }
     }

+ 36 - 0
deltachat-ios/DC/Wrapper.swift

@@ -203,6 +203,11 @@ class DcContext {
     func updateDeviceChats() {
     func updateDeviceChats() {
         dc_update_device_chats(contextPointer)
         dc_update_device_chats(contextPointer)
     }
     }
+
+    func getProviderFromEmail(addr: String) -> DcProvider? {
+        guard let dcProviderPointer = dc_provider_new_from_email(contextPointer, addr) else { return nil }
+        return DcProvider(dcProviderPointer)
+    }
 }
 }
 
 
 class DcConfig {
 class DcConfig {
@@ -988,6 +993,37 @@ class DcLot {
     }
     }
 }
 }
 
 
+class DcProvider {
+    private var dcProviderPointer: OpaquePointer?
+
+    // takes ownership of specified pointer
+    init(_ dcProviderPointer: OpaquePointer) {
+        self.dcProviderPointer = dcProviderPointer
+    }
+
+    deinit {
+        dc_provider_unref(dcProviderPointer)
+    }
+
+    var status: Int {
+        return Int(dc_provider_get_status(dcProviderPointer))
+    }
+
+    var beforeLoginHint: String {
+        guard let cString = dc_provider_get_before_login_hint(dcProviderPointer) else { return "" }
+        let swiftString = String(cString: cString)
+        dc_str_unref(cString)
+        return swiftString
+    }
+
+    var getOverviewPage: String {
+        guard let cString = dc_provider_get_overview_page(dcProviderPointer) else { return "" }
+        let swiftString = String(cString: cString)
+        dc_str_unref(cString)
+        return swiftString
+    }
+}
+
 enum ChatType: Int {
 enum ChatType: Int {
     case SINGLE = 100
     case SINGLE = 100
     case GROUP = 120
     case GROUP = 120

+ 2 - 0
deltachat-ios/Helper/Colors.swift

@@ -18,6 +18,8 @@ struct DcColors {
                                                      dark: UIColor(red: 10 / 255, green: 10 / 255, blue: 10 / 255, alpha: 1))
                                                      dark: UIColor(red: 10 / 255, green: 10 / 255, blue: 10 / 255, alpha: 1))
     static let placeholderColor = UIColor.themeColor(light: UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 1),
     static let placeholderColor = UIColor.themeColor(light: UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 1),
                                                      dark: UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1))
                                                      dark: UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1))
+    static let providerPreparationBackground = UIColor.themeColor(lightHex: "#fffdf7b2", darkHex: "##fffdf7b2")
+    static let providerBrokenBackground = UIColor.themeColor(light: SystemColor.red.uiColor, dark: SystemColor.red.uiColor)
     static let systemMessageBackgroundColor = UIColor.themeColor(light: UIColor.rgb(red: 248, green: 248, blue: 248), dark: UIColor(white: 0.2, alpha: 0.5))
     static let systemMessageBackgroundColor = UIColor.themeColor(light: UIColor.rgb(red: 248, green: 248, blue: 248), dark: UIColor(white: 0.2, alpha: 0.5))
     static let deaddropBackground = UIColor.themeColor(light: UIColor.init(hexString: "ebebec"), dark: UIColor.init(hexString: "1a1a1c"))
     static let deaddropBackground = UIColor.themeColor(light: UIColor.init(hexString: "ebebec"), dark: UIColor.init(hexString: "1a1a1c"))
 }
 }

+ 3 - 0
deltachat-ios/Helper/TypeAlias.swift

@@ -0,0 +1,3 @@
+import Foundation
+
+typealias VoidFunction = () -> Void

+ 111 - 0
deltachat-ios/View/ProviderInfoCell.swift

@@ -0,0 +1,111 @@
+import UIKit
+
+enum ProviderInfoStatus: Int {
+    case preparation = 2
+    case broken = 3
+ }
+
+class ProviderInfoCell: UITableViewCell {
+
+    private struct ColorSet {
+        let backgroundColor: UIColor
+        let tintColor: UIColor
+    }
+
+    private let fontSize: CGFloat = 14
+
+    private let brokenColorSet: ColorSet = ColorSet(
+        backgroundColor: DcColors.providerBrokenBackground,
+        tintColor: UIColor.white
+    )
+
+    private let preparationColorSet: ColorSet = ColorSet(
+        backgroundColor: DcColors.providerPreparationBackground,
+        tintColor: DcColors.grayTextColor
+    )
+
+    var onInfoButtonPressed: VoidFunction?
+
+    private var hintBackgroundView: UIView = {
+        let view = UIView()
+        return view
+    }()
+
+    private lazy var hintLabel: UILabel = {
+        let label = UILabel()
+        label.numberOfLines = 0
+        label.font = UIFont.systemFont(ofSize: fontSize)
+        return label
+    }()
+
+    private lazy var infoButton: UIButton = {
+        let button = UIButton()
+        let title = String.localized("more_info_desktop")
+        button.setTitle(title, for: .normal)
+        button.titleLabel?.font = UIFont.boldSystemFont(ofSize: fontSize)
+        button.addTarget(self, action: #selector(infoButtonPressed(_:)), for: .touchUpInside)
+        return button
+    }()
+
+    init() {
+        super.init(style: .default, reuseIdentifier: nil)
+        setupSubviews()
+    }
+
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        // ... no highlight
+    }
+
+    private func setupSubviews() {
+
+        let margin: CGFloat = 15
+        let padding: CGFloat = 10
+
+        contentView.addSubview(hintBackgroundView)
+        hintBackgroundView.addSubview(hintLabel)
+        hintBackgroundView.addSubview(infoButton)
+
+        hintBackgroundView.translatesAutoresizingMaskIntoConstraints = false
+        hintLabel.translatesAutoresizingMaskIntoConstraints = false
+        infoButton.translatesAutoresizingMaskIntoConstraints = false
+
+        hintBackgroundView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: margin).isActive = true
+        hintBackgroundView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: margin).isActive = true
+        hintBackgroundView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -margin).isActive = true
+        hintBackgroundView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -margin).isActive = true
+
+        hintLabel.leadingAnchor.constraint(equalTo: hintBackgroundView.leadingAnchor, constant: padding).isActive = true
+        hintLabel.topAnchor.constraint(equalTo: hintBackgroundView.topAnchor, constant: padding).isActive = true
+        hintLabel.trailingAnchor.constraint(equalTo: hintBackgroundView.trailingAnchor, constant: -padding).isActive = true
+
+        infoButton.topAnchor.constraint(equalTo: hintLabel.bottomAnchor, constant: padding).isActive = true
+        infoButton.leadingAnchor.constraint(equalTo: hintBackgroundView.leadingAnchor, constant: padding).isActive = true
+        infoButton.bottomAnchor.constraint(equalTo: hintBackgroundView.bottomAnchor, constant: -padding).isActive = true
+    }
+
+    // MARK: - update
+    func updateInfo(hint text: String?, hintType: ProviderInfoStatus?) {
+        hintLabel.text = text
+        switch hintType {
+        case .preparation:
+            hintBackgroundView.backgroundColor = preparationColorSet.backgroundColor
+            hintLabel.textColor = preparationColorSet.tintColor
+            infoButton.setTitleColor(preparationColorSet.tintColor, for: .normal)
+        case .broken:
+            hintBackgroundView.backgroundColor = brokenColorSet.backgroundColor
+            hintLabel.textColor = brokenColorSet.tintColor
+            infoButton.setTitleColor(brokenColorSet.tintColor, for: .normal)
+        case .none:
+            break
+        }
+    }
+
+    // MARK: - actions
+    @objc func infoButtonPressed(_:UIButton) {
+        onInfoButtonPressed?()
+    }
+}