mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Hide SIP domains in suggestion list
This commit is contained in:
parent
e9eebbd45a
commit
068b93cf1c
5 changed files with 104 additions and 16 deletions
|
|
@ -219,6 +219,11 @@ class CoreContext: ObservableObject {
|
|||
account.params = newParams
|
||||
}
|
||||
|
||||
// TODO: Temporary workaround until SDK fixs
|
||||
if CorePreferences.defaultDomain == "" {
|
||||
CorePreferences.defaultDomain = core.defaultAccount?.params?.domain ?? ""
|
||||
}
|
||||
|
||||
self.actionsToPerformOnCoreQueueWhenCoreIsStarted.forEach { $0(core) }
|
||||
self.actionsToPerformOnCoreQueueWhenCoreIsStarted.removeAll()
|
||||
|
||||
|
|
|
|||
|
|
@ -275,6 +275,7 @@ struct ConversationForwardMessageFragment: View {
|
|||
HStack {
|
||||
if index < contactsManager.lastSearchSuggestions.count
|
||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||
lastName: ""))
|
||||
|
|
@ -284,9 +285,29 @@ struct ConversationForwardMessageFragment: View {
|
|||
|
||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
} else {
|
||||
if let address = contactsManager.lastSearchSuggestions[index].address {
|
||||
let nameTmp = address.displayName
|
||||
?? address.username
|
||||
?? String(address.asStringUriOnly().dropFirst(4))
|
||||
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: nameTmp,
|
||||
lastName: ""))
|
||||
.resizable()
|
||||
.frame(width: 45, height: 45)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text(nameTmp)
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Image("profil-picture-default")
|
||||
.resizable()
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ struct StartConversationFragment: View {
|
|||
HStack {
|
||||
if index < contactsManager.lastSearchSuggestions.count
|
||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||
lastName: ""))
|
||||
|
|
@ -266,9 +267,29 @@ struct StartConversationFragment: View {
|
|||
|
||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
} else {
|
||||
if let address = contactsManager.lastSearchSuggestions[index].address {
|
||||
let nameTmp = address.displayName
|
||||
?? address.username
|
||||
?? String(address.asStringUriOnly().dropFirst(4))
|
||||
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: nameTmp,
|
||||
lastName: ""))
|
||||
.resizable()
|
||||
.frame(width: 45, height: 45)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text(nameTmp)
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Image("profil-picture-default")
|
||||
.resizable()
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ struct StartCallFragment: View {
|
|||
HStack {
|
||||
if index < contactsManager.lastSearchSuggestions.count
|
||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||
lastName: ""))
|
||||
|
|
@ -394,9 +395,29 @@ struct StartCallFragment: View {
|
|||
|
||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
} else {
|
||||
if let address = contactsManager.lastSearchSuggestions[index].address {
|
||||
let nameTmp = address.displayName
|
||||
?? address.username
|
||||
?? String(address.asStringUriOnly().dropFirst(4))
|
||||
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: nameTmp,
|
||||
lastName: ""))
|
||||
.resizable()
|
||||
.frame(width: 45, height: 45)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text(nameTmp)
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Image("profil-picture-default")
|
||||
.resizable()
|
||||
|
|
|
|||
|
|
@ -282,19 +282,39 @@ struct AddParticipantsFragment: View {
|
|||
HStack {
|
||||
if index < contactsManager.lastSearchSuggestions.count
|
||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||
lastName: ""))
|
||||
.resizable()
|
||||
.frame(width: 45, height: 45)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||
lastName: ""))
|
||||
.resizable()
|
||||
.frame(width: 45, height: 45)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
} else {
|
||||
if let address = contactsManager.lastSearchSuggestions[index].address {
|
||||
let nameTmp = address.displayName
|
||||
?? address.username
|
||||
?? String(address.asStringUriOnly().dropFirst(4))
|
||||
|
||||
Image(uiImage: contactsManager.textToImage(
|
||||
firstName: nameTmp,
|
||||
lastName: ""))
|
||||
.resizable()
|
||||
.frame(width: 45, height: 45)
|
||||
.clipShape(Circle())
|
||||
|
||||
Text(nameTmp)
|
||||
.default_text_style(styleSize: 16)
|
||||
.lineLimit(1)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundStyle(Color.orangeMain500)
|
||||
}
|
||||
}
|
||||
|
||||
if let searchAddress = contactsManager.lastSearchSuggestions[index].address?.asStringUriOnly() {
|
||||
if addParticipantsViewModel.participantsToAdd.contains(where: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue