Removed TODOs related to friends' refKey

This commit is contained in:
Sylvain Berfini 2024-11-18 10:41:48 +01:00
parent 90971224d5
commit 4f5ea3b5a4
2 changed files with 12 additions and 12 deletions

View file

@ -210,15 +210,11 @@ class ContactNewOrEditViewModel @UiThread constructor() : GenericViewModel() {
updatePhoneNumbers()
if (isEdit.value == false) {
if (friend.vcard?.generateUniqueId() == true) {
friend.refKey = friend.vcard?.uid
Log.i(
"$TAG Newly created friend will have generated ref key [${friend.refKey}]"
)
} else {
Log.e("$TAG Failed to generate a ref key using vCard's generateUniqueId()")
// TODO: generate unique ref key?
}
friend.vcard?.generateUniqueId()
friend.refKey = friend.vcard?.uid
Log.i(
"$TAG Newly created friend will have generated ref key [${friend.refKey}]"
)
friend.isSubscribesEnabled = false
// Disable peer to peer short term presence

View file

@ -281,9 +281,13 @@ class ContactsListViewModel @UiThread constructor() : AbstractMainViewModel() {
for (result in results) {
val friend = result.friend
if (friend != null && result.sourceFlags == MagicSearch.Source.LdapServers.toInt()) {
// TODO FIXME: Fix issue in SDK, each LDAP friend should have a proper refKey
friend.refKey = friend.name
if (friend != null && friend.refKey.orEmpty().isEmpty()) {
if (friend.vcard != null) {
friend.vcard?.generateUniqueId()
friend.refKey = friend.vcard?.uid
} else {
friend.refKey = friend.name
}
}
val model = if (friend != null) {