mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-18 20:08:53 +01:00
Merge branch 'master' into upgrade-smsmms-group-individual-send-no-wait-appear-delayed-mms-mms-receive-to-worker-send-ack-mmsc
This commit is contained in:
@@ -31,6 +31,7 @@ open class Conversation(
|
||||
var recipients: RealmList<Recipient> = RealmList(),
|
||||
var lastMessage: Message? = null,
|
||||
var draft: String = "",
|
||||
var draftDate: Long = 0,
|
||||
|
||||
var blockingClient: Int? = null,
|
||||
var blockReason: String? = null,
|
||||
@@ -40,7 +41,7 @@ open class Conversation(
|
||||
var sendAsGroup: Boolean = false,
|
||||
) : RealmObject() {
|
||||
|
||||
val date: Long get() = lastMessage?.date ?: 0
|
||||
val date: Long get() = lastMessage?.date ?: if (draft.isNotEmpty()) draftDate else 0
|
||||
val snippet: String? get() = lastMessage?.getSummary()
|
||||
val unread: Boolean get() = lastMessage?.read == false
|
||||
val me: Boolean get() = lastMessage?.isMe() == true
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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 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
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2025
|
||||
*
|
||||
* This file is part of QUIK.
|
||||
*
|
||||
* QUIK 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.
|
||||
*
|
||||
* QUIK 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 QUIK. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package dev.octoshrimpy.quik.model
|
||||
|
||||
import io.realm.RealmObject
|
||||
|
||||
open class EmojiSyncNeeded : RealmObject() {
|
||||
var createdAt: Long = System.currentTimeMillis()
|
||||
}
|
||||
@@ -20,7 +20,9 @@ package dev.octoshrimpy.quik.model
|
||||
|
||||
import android.content.ContentUris
|
||||
import android.net.Uri
|
||||
import android.provider.Telephony.*
|
||||
import android.provider.Telephony.Mms
|
||||
import android.provider.Telephony.MmsSms
|
||||
import android.provider.Telephony.Sms
|
||||
import dev.octoshrimpy.quik.extensions.joinTo
|
||||
import io.realm.RealmList
|
||||
import io.realm.RealmObject
|
||||
@@ -76,6 +78,8 @@ open class Message : RealmObject() {
|
||||
var subject: String = ""
|
||||
var textContentType: String = ""
|
||||
var parts: RealmList<MmsPart> = RealmList()
|
||||
var isEmojiReaction: Boolean = false
|
||||
val emojiReactions: RealmList<EmojiReaction> = RealmList()
|
||||
|
||||
var sendAsGroup: Boolean = false
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package dev.octoshrimpy.quik.model
|
||||
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.PrimaryKey
|
||||
|
||||
open class MessageContentFilter(
|
||||
@PrimaryKey var id: Long = 0,
|
||||
|
||||
var value: String = "",
|
||||
var caseSensitive: Boolean = false,
|
||||
var isRegex: Boolean = false,
|
||||
var includeContacts: Boolean = false
|
||||
) : RealmObject()
|
||||
|
||||
data class MessageContentFilterData(
|
||||
var value: String = "",
|
||||
var caseSensitive: Boolean = false,
|
||||
var isRegex: Boolean = false,
|
||||
var includeContacts: Boolean = false
|
||||
)
|
||||
@@ -21,7 +21,7 @@ package dev.octoshrimpy.quik.model
|
||||
import android.telephony.PhoneNumberUtils
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.PrimaryKey
|
||||
import java.util.*
|
||||
import java.util.Locale
|
||||
|
||||
open class Recipient(
|
||||
@PrimaryKey var id: Long = 0,
|
||||
|
||||
@@ -29,7 +29,8 @@ open class ScheduledMessage(
|
||||
var recipients: RealmList<String> = RealmList(),
|
||||
var sendAsGroup: Boolean = true,
|
||||
var body: String = "",
|
||||
var attachments: RealmList<String> = RealmList()
|
||||
var attachments: RealmList<String> = RealmList(),
|
||||
var conversationId: Long = 0
|
||||
) : RealmObject() {
|
||||
|
||||
fun copy(
|
||||
@@ -39,10 +40,11 @@ open class ScheduledMessage(
|
||||
recipients: RealmList<String> = this.recipients,
|
||||
sendAsGroup: Boolean = this.sendAsGroup,
|
||||
body: String = this.body,
|
||||
attachments: RealmList<String> = this.attachments
|
||||
attachments: RealmList<String> = this.attachments,
|
||||
conversationId: Long = this.conversationId
|
||||
): ScheduledMessage {
|
||||
|
||||
return ScheduledMessage(id, date, subId, recipients, sendAsGroup, body, attachments)
|
||||
return ScheduledMessage(id, date, subId, recipients, sendAsGroup, body, attachments, conversationId)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user