From e9eebbd45a4cf950b2391a9f090cad1b08a105bd Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Wed, 1 Oct 2025 15:08:37 +0200 Subject: [PATCH] Hide SIP addresses via settings --- Linphone/Core/CorePreferences.swift | 9 + Linphone/UI/Call/CallView.swift | 6 +- .../ContactInnerActionsFragment.swift | 230 +++++++++--------- .../ViewModel/EditContactViewModel.swift | 6 +- .../Fragments/ConversationInfoFragment.swift | 14 +- .../Fragments/HistoryContactFragment.swift | 14 +- .../Fragments/AccountProfileFragment.swift | 46 ++-- 7 files changed, 175 insertions(+), 150 deletions(-) diff --git a/Linphone/Core/CorePreferences.swift b/Linphone/Core/CorePreferences.swift index 1f1e4ca6d..825a4f25d 100644 --- a/Linphone/Core/CorePreferences.swift +++ b/Linphone/Core/CorePreferences.swift @@ -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 { diff --git a/Linphone/UI/Call/CallView.swift b/Linphone/UI/Call/CallView.swift index 5e0e44be4..a941ff167 100644 --- a/Linphone/UI/Call/CallView.swift +++ b/Linphone/UI/Call/CallView.swift @@ -526,8 +526,10 @@ struct CallView: View { .padding(.top) .default_text_style_white(styleSize: 22) - Text(callViewModel.remoteAddressCleanedString) - .default_text_style_white_300(styleSize: 16) + if !CorePreferences.hideSipAddresses { + Text(callViewModel.remoteAddressCleanedString) + .default_text_style_white_300(styleSize: 16) + } Spacer() } diff --git a/Linphone/UI/Main/Contacts/Fragments/ContactInnerActionsFragment.swift b/Linphone/UI/Main/Contacts/Fragments/ContactInnerActionsFragment.swift index 18a5addc3..d77ad3971 100644 --- a/Linphone/UI/Main/Contacts/Fragments/ContactInnerActionsFragment.swift +++ b/Linphone/UI/Main/Contacts/Fragments/ContactInnerActionsFragment.swift @@ -39,127 +39,135 @@ struct ContactInnerActionsFragment: View { var actionEditButton: () -> Void - var body: some View { - HStack(alignment: .center) { - Text("contact_details_numbers_and_addresses_title") - .default_text_style_800(styleSize: 15) - - Spacer() - - Image(informationIsOpen ? "caret-up" : "caret-down") - .renderingMode(.template) - .resizable() - .foregroundStyle(Color.grayMain2c600) - .frame(width: 25, height: 25, alignment: .leading) - .padding(.all, 10) - } - .padding(.top, 30) - .padding(.bottom, 10) - .padding(.horizontal, 16) - .background(Color.gray100) - .onTapGesture { - withAnimation { - informationIsOpen.toggle() - } - } - - if informationIsOpen { - VStack(spacing: 0) { - ForEach(0..