|
@@ -9,7 +9,8 @@ class NewChatViewController: UITableViewController {
|
|
|
private let sectionNewRowNewContact = 0
|
|
|
private let sectionNewRowNewGroup = 1
|
|
|
private let sectionNewRowNewVerifiedGroup = 2
|
|
|
- private let sectionNewRowCount = 3
|
|
|
+ private let sectionNewRowBroadcastList = 3
|
|
|
+ private var sectionNewRowCount: Int { return UserDefaults.standard.bool(forKey: "broadcast_lists") ? 4 : 3 }
|
|
|
|
|
|
private let sectionImportedContacts = 1
|
|
|
|
|
@@ -147,6 +148,8 @@ class NewChatViewController: UITableViewController {
|
|
|
actionCell.actionTitle = String.localized("menu_new_group")
|
|
|
case sectionNewRowNewVerifiedGroup:
|
|
|
actionCell.actionTitle = String.localized("menu_new_verified_group")
|
|
|
+ case sectionNewRowBroadcastList:
|
|
|
+ actionCell.actionTitle = String.localized("new_broadcast_list")
|
|
|
default:
|
|
|
actionCell.actionTitle = String.localized("menu_new_contact")
|
|
|
}
|
|
@@ -188,6 +191,8 @@ class NewChatViewController: UITableViewController {
|
|
|
showNewGroupController(isVerified: false)
|
|
|
} else if row == sectionNewRowNewVerifiedGroup {
|
|
|
showNewGroupController(isVerified: true)
|
|
|
+ } else if row == sectionNewRowBroadcastList {
|
|
|
+ showNewGroupController(isVerified: false, createBroadcast: true)
|
|
|
} else if row == sectionNewRowNewContact {
|
|
|
showNewContactController()
|
|
|
}
|
|
@@ -308,7 +313,7 @@ class NewChatViewController: UITableViewController {
|
|
|
}
|
|
|
|
|
|
// MARK: - coordinator
|
|
|
- private func showNewGroupController(isVerified: Bool) {
|
|
|
+ private func showNewGroupController(isVerified: Bool, createBroadcast: Bool = false) {
|
|
|
let newGroupController = NewGroupController(dcContext: dcContext, isVerified: isVerified)
|
|
|
navigationController?.pushViewController(newGroupController, animated: true)
|
|
|
}
|