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
|
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.forEach { $0(core) }
|
||||||
self.actionsToPerformOnCoreQueueWhenCoreIsStarted.removeAll()
|
self.actionsToPerformOnCoreQueueWhenCoreIsStarted.removeAll()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -275,6 +275,7 @@ struct ConversationForwardMessageFragment: View {
|
||||||
HStack {
|
HStack {
|
||||||
if index < contactsManager.lastSearchSuggestions.count
|
if index < contactsManager.lastSearchSuggestions.count
|
||||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||||
|
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||||
Image(uiImage: contactsManager.textToImage(
|
Image(uiImage: contactsManager.textToImage(
|
||||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||||
lastName: ""))
|
lastName: ""))
|
||||||
|
|
@ -284,9 +285,29 @@ struct ConversationForwardMessageFragment: View {
|
||||||
|
|
||||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||||
.default_text_style(styleSize: 16)
|
.default_text_style(styleSize: 16)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.foregroundStyle(Color.orangeMain500)
|
.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 {
|
} else {
|
||||||
Image("profil-picture-default")
|
Image("profil-picture-default")
|
||||||
.resizable()
|
.resizable()
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,7 @@ struct StartConversationFragment: View {
|
||||||
HStack {
|
HStack {
|
||||||
if index < contactsManager.lastSearchSuggestions.count
|
if index < contactsManager.lastSearchSuggestions.count
|
||||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||||
|
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||||
Image(uiImage: contactsManager.textToImage(
|
Image(uiImage: contactsManager.textToImage(
|
||||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||||
lastName: ""))
|
lastName: ""))
|
||||||
|
|
@ -266,9 +267,29 @@ struct StartConversationFragment: View {
|
||||||
|
|
||||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||||
.default_text_style(styleSize: 16)
|
.default_text_style(styleSize: 16)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.foregroundStyle(Color.orangeMain500)
|
.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 {
|
} else {
|
||||||
Image("profil-picture-default")
|
Image("profil-picture-default")
|
||||||
.resizable()
|
.resizable()
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,7 @@ struct StartCallFragment: View {
|
||||||
HStack {
|
HStack {
|
||||||
if index < contactsManager.lastSearchSuggestions.count
|
if index < contactsManager.lastSearchSuggestions.count
|
||||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||||
|
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||||
Image(uiImage: contactsManager.textToImage(
|
Image(uiImage: contactsManager.textToImage(
|
||||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||||
lastName: ""))
|
lastName: ""))
|
||||||
|
|
@ -394,9 +395,29 @@ struct StartCallFragment: View {
|
||||||
|
|
||||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||||
.default_text_style(styleSize: 16)
|
.default_text_style(styleSize: 16)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.foregroundStyle(Color.orangeMain500)
|
.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 {
|
} else {
|
||||||
Image("profil-picture-default")
|
Image("profil-picture-default")
|
||||||
.resizable()
|
.resizable()
|
||||||
|
|
|
||||||
|
|
@ -282,19 +282,39 @@ struct AddParticipantsFragment: View {
|
||||||
HStack {
|
HStack {
|
||||||
if index < contactsManager.lastSearchSuggestions.count
|
if index < contactsManager.lastSearchSuggestions.count
|
||||||
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
&& contactsManager.lastSearchSuggestions[index].address != nil {
|
||||||
Image(uiImage: contactsManager.textToImage(
|
if contactsManager.lastSearchSuggestions[index].address!.domain != CorePreferences.defaultDomain {
|
||||||
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
Image(uiImage: contactsManager.textToImage(
|
||||||
lastName: ""))
|
firstName: String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)),
|
||||||
.resizable()
|
lastName: ""))
|
||||||
.frame(width: 45, height: 45)
|
.resizable()
|
||||||
.clipShape(Circle())
|
.frame(width: 45, height: 45)
|
||||||
|
.clipShape(Circle())
|
||||||
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
|
||||||
.default_text_style(styleSize: 16)
|
Text(String(contactsManager.lastSearchSuggestions[index].address!.asStringUriOnly().dropFirst(4)))
|
||||||
.lineLimit(1)
|
.default_text_style(styleSize: 16)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.foregroundStyle(Color.orangeMain500)
|
.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 let searchAddress = contactsManager.lastSearchSuggestions[index].address?.asStringUriOnly() {
|
||||||
if addParticipantsViewModel.participantsToAdd.contains(where: {
|
if addParticipantsViewModel.participantsToAdd.contains(where: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue