forked from upstream-mirrors/quik
Parse and render emoji reactions
Fixes part of #152 To keep this PR simple, I've left out: - when long-pressing on the emoji in a group MMS, a popup should come up listing which contact sent each emoji - notifications (untested) - sending emoji reactions
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2025
|
||||
*
|
||||
* This file is part of QUIK.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package dev.octoshrimpy.quik.model
|
||||
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.Index
|
||||
import io.realm.annotations.PrimaryKey
|
||||
|
||||
open class EmojiReaction : RealmObject() {
|
||||
@PrimaryKey var id: Long = 0
|
||||
|
||||
/** The message this is a reaction to */
|
||||
@Index var targetMessageId: Long = 0
|
||||
|
||||
/** The reaction message ID itself */
|
||||
@Index var reactionMessageId: Long = 0
|
||||
|
||||
/** The sender's address (phone number) */
|
||||
var senderAddress: String = ""
|
||||
|
||||
/** The emoji used in the reaction */
|
||||
var emoji: String = ""
|
||||
|
||||
/** The original message text that was reacted to */
|
||||
var originalMessageText: String = ""
|
||||
|
||||
/** Thread ID for easier querying */
|
||||
@Index var threadId: Long = 0
|
||||
|
||||
/**
|
||||
* Pattern type that was matched (for debugging)
|
||||
*
|
||||
* for example, "ios" or "google"
|
||||
*/
|
||||
var patternType: String = ""
|
||||
}
|
||||
@@ -74,6 +74,7 @@ open class Message : RealmObject() {
|
||||
var subject: String = ""
|
||||
var textContentType: String = ""
|
||||
var parts: RealmList<MmsPart> = RealmList()
|
||||
var isEmojiReaction: Boolean = false
|
||||
|
||||
fun getUri(): Uri {
|
||||
val baseUri = if (isMms()) Mms.CONTENT_URI else Sms.CONTENT_URI
|
||||
|
||||
Reference in New Issue
Block a user