Fix story reactions rendering improperly after restoring a backup.

This commit is contained in:
jeffrey-signal
2025-06-05 12:04:39 -04:00
committed by Greyson Parrelli
parent a9475ef153
commit bf0c9ec1c7
2 changed files with 7 additions and 4 deletions

View File

@@ -84,7 +84,7 @@ import java.util.UUID
import org.thoughtcrime.securesms.backup.v2.proto.GiftBadge as BackupGiftBadge
/**
* An object that will ingest all fo the [ChatItem]s you want to write, buffer them until hitting a specified batch size, and then batch insert them
* An object that will ingest all of the [ChatItem]s you want to write, buffer them until hitting a specified batch size, and then batch insert them
* for fast throughput.
*/
class ChatItemArchiveImporter(
@@ -519,7 +519,7 @@ class ChatItemArchiveImporter(
this.paymentNotification != null -> contentValues.addPaymentNotification(this, chatRecipientId)
this.giftBadge != null -> contentValues.addGiftBadge(this.giftBadge)
this.viewOnceMessage != null -> contentValues.addViewOnce(this.viewOnceMessage)
this.directStoryReplyMessage != null -> contentValues.addDirectStoryReply(this.directStoryReplyMessage)
this.directStoryReplyMessage != null -> contentValues.addDirectStoryReply(this.directStoryReplyMessage, toRecipientId)
}
return contentValues
@@ -874,8 +874,11 @@ class ChatItemArchiveImporter(
put(MessageTable.VIEW_ONCE, true.toInt())
}
private fun ContentValues.addDirectStoryReply(directStoryReply: DirectStoryReplyMessage) {
private fun ContentValues.addDirectStoryReply(directStoryReply: DirectStoryReplyMessage, toRecipientId: RecipientId) {
put(MessageTable.PARENT_STORY_ID, MessageTable.PARENT_STORY_MISSING_ID)
put(MessageTable.QUOTE_MISSING, 1)
put(MessageTable.QUOTE_ID, MessageTable.QUOTE_TARGET_MISSING_ID)
put(MessageTable.QUOTE_AUTHOR, toRecipientId.serialize())
if (directStoryReply.emoji != null) {
put(MessageTable.BODY, directStoryReply.emoji)

View File

@@ -80,7 +80,7 @@ class ConversationAdapterV2(
companion object {
private val TAG = Log.tag(ConversationAdapterV2::class.java)
private val MIN_GROUPS_THRESHOLD = 2
private const val MIN_GROUPS_THRESHOLD = 2
}
private val _selected = hashSetOf<MultiselectPart>()