fix: don't add contacts if they don't exist in the profile manager

This commit is contained in:
0x330a 2023-05-22 16:22:04 +10:00
parent 1a3f432f85
commit 34f40d01f3
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C

View File

@ -95,6 +95,7 @@ class ProfileManager(private val context: Context, private val configFactory: Co
if (contact.sessionID == TextSecurePreferences.getLocalNumber(context)) return
val sessionId = SessionId(contact.sessionID)
if (sessionId.prefix != IdPrefix.STANDARD) return // only internally store standard session IDs
if (contactConfig.get(contact.sessionID) == null) return // don't insert, only update
contactConfig.upsertContact(contact.sessionID) {
this.name = contact.name.orEmpty()
this.nickname = contact.nickname.orEmpty()