mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 10:05:15 +00:00
SES-2819 - Do not show a reaction on a deleted message
This commit is contained in:
parent
cf344b7180
commit
711e31a43a
@ -1686,12 +1686,17 @@ open class Storage(
|
||||
val timestamp = reaction.timestamp
|
||||
val localId = reaction.localId
|
||||
val isMms = reaction.isMms
|
||||
val messageRecord = timestamp?.let{ DatabaseComponent.get(context).mmsSmsDatabase().getMessageForTimestamp(timestamp) }
|
||||
|
||||
// leave if this is about a deleted messsage
|
||||
if (messageRecord?.isDeleted == true) return
|
||||
|
||||
val messageId = if (localId != null && localId > 0 && isMms != null) {
|
||||
MessageId(localId, isMms)
|
||||
} else if (timestamp != null && timestamp > 0) {
|
||||
val messageRecord = DatabaseComponent.get(context).mmsSmsDatabase().getMessageForTimestamp(timestamp) ?: return
|
||||
} else if (messageRecord != null && timestamp > 0) {
|
||||
MessageId(messageRecord.id, messageRecord.isMms)
|
||||
} else return
|
||||
|
||||
DatabaseComponent.get(context).reactionDatabase().addReaction(
|
||||
messageId,
|
||||
ReactionRecord(
|
||||
|
Loading…
Reference in New Issue
Block a user