mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
fix: don't add contacts if they don't exist in the profile manager
This commit is contained in:
parent
1a3f432f85
commit
34f40d01f3
@ -95,6 +95,7 @@ class ProfileManager(private val context: Context, private val configFactory: Co
|
|||||||
if (contact.sessionID == TextSecurePreferences.getLocalNumber(context)) return
|
if (contact.sessionID == TextSecurePreferences.getLocalNumber(context)) return
|
||||||
val sessionId = SessionId(contact.sessionID)
|
val sessionId = SessionId(contact.sessionID)
|
||||||
if (sessionId.prefix != IdPrefix.STANDARD) return // only internally store standard session IDs
|
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) {
|
contactConfig.upsertContact(contact.sessionID) {
|
||||||
this.name = contact.name.orEmpty()
|
this.name = contact.name.orEmpty()
|
||||||
this.nickname = contact.nickname.orEmpty()
|
this.nickname = contact.nickname.orEmpty()
|
||||||
|
Loading…
Reference in New Issue
Block a user