Skip to content

Commit

Permalink
for chatmail accounts, hide some not useful settings
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed May 14, 2024
1 parent 8032e1f commit 679f7f3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
40 changes: 26 additions & 14 deletions deltachat-ios/Controller/Settings/AdvancedViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,32 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
headerTitle: String.localized("pref_experimental_features"),
footerTitle: nil,
cells: [videoChatInstanceCell, broadcastListsCell, locationStreamingCell])
let appAccessSection = SectionConfigs(
headerTitle: String.localized("pref_app_access"),
footerTitle: String.localized("pref_show_system_contacts_explain"),
cells: [showSystemContactsCell])
let autocryptSection = SectionConfigs(
headerTitle: String.localized("pref_encryption"),
footerTitle: nil,
cells: [autocryptPreferencesCell, manageKeysCell, sendAutocryptMessageCell]
)
let serverSection = SectionConfigs(
headerTitle: String.localized("pref_server"),
footerTitle: String.localized("pref_only_fetch_mvbox_explain"),
cells: [accountSettingsCell, sentboxWatchCell, sendCopyToSelfCell, mvboxMoveCell, onlyFetchMvboxCell])
return [viewLogSection, experimentalSection, appAccessSection, autocryptSection, serverSection]

if dcContext.isChatmail {
let autocryptSection = SectionConfigs(
headerTitle: String.localized("pref_encryption"),
footerTitle: nil,
cells: [manageKeysCell, sendAutocryptMessageCell])
let serverSection = SectionConfigs(
headerTitle: String.localized("pref_server"),
footerTitle: nil,
cells: [accountSettingsCell])
return [viewLogSection, experimentalSection, autocryptSection, serverSection]
} else {
let appAccessSection = SectionConfigs(
headerTitle: String.localized("pref_app_access"),
footerTitle: String.localized("pref_show_system_contacts_explain"),
cells: [showSystemContactsCell])
let autocryptSection = SectionConfigs(
headerTitle: String.localized("pref_encryption"),
footerTitle: nil,
cells: [autocryptPreferencesCell, manageKeysCell, sendAutocryptMessageCell])
let serverSection = SectionConfigs(
headerTitle: String.localized("pref_server"),
footerTitle: String.localized("pref_only_fetch_mvbox_explain"),
cells: [accountSettingsCell, sentboxWatchCell, sendCopyToSelfCell, mvboxMoveCell, onlyFetchMvboxCell])
return [viewLogSection, experimentalSection, appAccessSection, autocryptSection, serverSection]
}
}()

init(dcAccounts: DcAccounts) {
Expand Down
4 changes: 4 additions & 0 deletions deltachat-ios/DC/DcContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,8 @@ public class DcContext {
get { return getConfigInt("show_emails") }
set { setConfigInt("show_emails", newValue) }
}

public var isChatmail: Bool {
return getConfigInt("is_chatmail") == 1
}
}

0 comments on commit 679f7f3

Please sign in to comment.