mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Hide SIP addresses via settings
This commit is contained in:
parent
1c3680df65
commit
e9eebbd45a
7 changed files with 175 additions and 150 deletions
|
|
@ -274,6 +274,15 @@ class CorePreferences {
|
|||
}
|
||||
}
|
||||
|
||||
static var hideSipAddresses: Bool {
|
||||
get {
|
||||
return Config.get().getBool(section: "ui", key: "hide_sip_addresses", defaultValue: false)
|
||||
}
|
||||
set {
|
||||
Config.get().setBool(section: "ui", key: "hide_sip_addresses", value: newValue)
|
||||
}
|
||||
}
|
||||
|
||||
private func copy(from: String, to: String, overrideIfExists: Bool = false) {
|
||||
let fileManager = FileManager.default
|
||||
if fileManager.fileExists(atPath: to), !overrideIfExists {
|
||||
|
|
|
|||
|
|
@ -526,8 +526,10 @@ struct CallView: View {
|
|||
.padding(.top)
|
||||
.default_text_style_white(styleSize: 22)
|
||||
|
||||
if !CorePreferences.hideSipAddresses {
|
||||
Text(callViewModel.remoteAddressCleanedString)
|
||||
.default_text_style_white_300(styleSize: 16)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ struct ContactInnerActionsFragment: View {
|
|||
var actionEditButton: () -> Void
|
||||
|
||||
var body: some View {
|
||||
if !CorePreferences.hideSipAddresses || (CorePreferences.hideSipAddresses && !contactAvatarModel.phoneNumbersWithLabel.isEmpty) {
|
||||
HStack(alignment: .center) {
|
||||
Text("contact_details_numbers_and_addresses_title")
|
||||
.default_text_style_800(styleSize: 15)
|
||||
|
|
@ -63,8 +64,10 @@ struct ContactInnerActionsFragment: View {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if informationIsOpen {
|
||||
VStack(spacing: 0) {
|
||||
if !CorePreferences.hideSipAddresses {
|
||||
ForEach(0..<contactAvatarModel.addresses.count, id: \.self) { index in
|
||||
HStack {
|
||||
HStack {
|
||||
|
|
@ -114,6 +117,7 @@ struct ContactInnerActionsFragment: View {
|
|||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ForEach(contactAvatarModel.phoneNumbersWithLabel.indices, id: \.self) { index in
|
||||
let entry = contactAvatarModel.phoneNumbersWithLabel[index]
|
||||
|
|
@ -160,6 +164,10 @@ struct ContactInnerActionsFragment: View {
|
|||
.zIndex(-1)
|
||||
.transition(.move(edge: .top))
|
||||
}
|
||||
} else {
|
||||
HStack {}
|
||||
.frame(height: 20)
|
||||
}
|
||||
|
||||
if !contactAvatarModel.organization.isEmpty || !contactAvatarModel.jobTitle.isEmpty {
|
||||
VStack {
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@ class EditContactViewModel: ObservableObject {
|
|||
|
||||
func resetValues() {
|
||||
CoreContext.shared.doOnCoreQueue { _ in
|
||||
let nativeUriTmp = (self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.nativeUri) ?? ""
|
||||
let nativeUriTmp = self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.nativeUri
|
||||
let givenNameTmp = (self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.vcard?.givenName) ?? ""
|
||||
let familyNameTmp = (self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.vcard?.familyName) ?? ""
|
||||
let organizationTmp = (self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.organization) ?? ""
|
||||
let jobTitleTmp = (self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.jobTitle) ?? ""
|
||||
let organizationTmp = self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.organization
|
||||
let jobTitleTmp = self.selectedEditFriend == nil ? "" : self.selectedEditFriend!.jobTitle
|
||||
|
||||
var sipAddressesTmp: [String] = []
|
||||
var phoneNumbersTmp: [String] = []
|
||||
|
|
|
|||
|
|
@ -104,12 +104,14 @@ struct ConversationInfoFragment: View {
|
|||
.frame(maxWidth: .infinity)
|
||||
.padding(.top, 10)
|
||||
|
||||
if !CorePreferences.hideSipAddresses {
|
||||
Text(conversationViewModel.participantConversationModel.first?.address ?? "")
|
||||
.foregroundStyle(Color.grayMain2c700)
|
||||
.multilineTextAlignment(.center)
|
||||
.default_text_style(styleSize: 14)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.top, 5)
|
||||
}
|
||||
|
||||
if !SharedMainViewModel.shared.displayedConversation!.avatarModel.lastPresenceInfo.isEmpty {
|
||||
Text(SharedMainViewModel.shared.displayedConversation!.avatarModel.lastPresenceInfo)
|
||||
|
|
|
|||
|
|
@ -187,12 +187,14 @@ struct HistoryContactFragment: View {
|
|||
.frame(maxWidth: .infinity)
|
||||
.padding(.top, 10)
|
||||
|
||||
if !CorePreferences.hideSipAddresses {
|
||||
Text(historyModel.address)
|
||||
.foregroundStyle(Color.grayMain2c700)
|
||||
.multilineTextAlignment(.center)
|
||||
.default_text_style(styleSize: 14)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.top, 5)
|
||||
}
|
||||
|
||||
if let avatarModel = historyModel.avatarModel {
|
||||
Text(avatarModel.lastPresenceInfo)
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ struct AccountProfileFragment: View {
|
|||
if accountModel.avatarModel != nil {
|
||||
VStack(spacing: 0) {
|
||||
VStack(spacing: 30) {
|
||||
if !CorePreferences.hideSipAddresses {
|
||||
HStack {
|
||||
Text(String(localized: "sip_address") + ":")
|
||||
.default_text_style_700(styleSize: 15)
|
||||
|
|
@ -294,6 +295,7 @@ struct AccountProfileFragment: View {
|
|||
.frame(width: 20, height: 20)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
Text("sip_address_display_name")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue