fix: don't process thread creation for user is sender && recipient (sync message) for message request responses

This commit is contained in:
0x330a 2023-04-28 12:31:16 +10:00
parent 456e272a45
commit d207d00423

View File

@ -1273,7 +1273,14 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
val userPublicKey = getUserPublicKey() val userPublicKey = getUserPublicKey()
val senderPublicKey = response.sender!! val senderPublicKey = response.sender!!
val recipientPublicKey = response.recipient!! val recipientPublicKey = response.recipient!!
if (userPublicKey == null || (userPublicKey != recipientPublicKey && userPublicKey != senderPublicKey)) return
if (
userPublicKey == null
|| (userPublicKey != recipientPublicKey && userPublicKey != senderPublicKey)
// this is true if it is a sync message
|| (userPublicKey == recipientPublicKey && userPublicKey == senderPublicKey)
) return
val recipientDb = DatabaseComponent.get(context).recipientDatabase() val recipientDb = DatabaseComponent.get(context).recipientDatabase()
val threadDB = DatabaseComponent.get(context).threadDatabase() val threadDB = DatabaseComponent.get(context).threadDatabase()
if (userPublicKey == senderPublicKey) { if (userPublicKey == senderPublicKey) {