mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-25 02:27:21 +00:00
fix quoting message in open groups
This commit is contained in:
parent
b490ed0c22
commit
42c7f440e9
@ -330,6 +330,10 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
DatabaseFactory.getLokiMessageDatabase(context).setServerID(messageID, serverID)
|
DatabaseFactory.getLokiMessageDatabase(context).setServerID(messageID, serverID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getQuoteServerID(quoteID: Long, publicKey: String): Long? {
|
||||||
|
return DatabaseFactory.getLokiMessageDatabase(context).getQuoteServerID(quoteID, publicKey)
|
||||||
|
}
|
||||||
|
|
||||||
override fun markAsSent(timestamp: Long, author: String) {
|
override fun markAsSent(timestamp: Long, author: String) {
|
||||||
val database = DatabaseFactory.getMmsSmsDatabase(context)
|
val database = DatabaseFactory.getMmsSmsDatabase(context)
|
||||||
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
val messageRecord = database.getMessageFor(timestamp, author) ?: return
|
||||||
|
@ -59,6 +59,8 @@ interface StorageProtocol {
|
|||||||
fun getThreadID(openGroupID: String): String?
|
fun getThreadID(openGroupID: String): String?
|
||||||
fun getAllOpenGroups(): Map<Long, PublicChat>
|
fun getAllOpenGroups(): Map<Long, PublicChat>
|
||||||
fun addOpenGroup(server: String, channel: Long)
|
fun addOpenGroup(server: String, channel: Long)
|
||||||
|
fun setOpenGroupServerMessageID(messageID: Long, serverID: Long)
|
||||||
|
fun getQuoteServerID(quoteID: Long, publicKey: String): Long?
|
||||||
|
|
||||||
// Open Group Public Keys
|
// Open Group Public Keys
|
||||||
fun getOpenGroupPublicKey(server: String): String?
|
fun getOpenGroupPublicKey(server: String): String?
|
||||||
@ -94,7 +96,6 @@ interface StorageProtocol {
|
|||||||
fun persistAttachments(messageId: Long, attachments: List<Attachment>): List<Long>
|
fun persistAttachments(messageId: Long, attachments: List<Attachment>): List<Long>
|
||||||
|
|
||||||
fun getMessageIdInDatabase(timestamp: Long, author: String): Long?
|
fun getMessageIdInDatabase(timestamp: Long, author: String): Long?
|
||||||
fun setOpenGroupServerMessageID(messageID: Long, serverID: Long)
|
|
||||||
fun markAsSent(timestamp: Long, author: String)
|
fun markAsSent(timestamp: Long, author: String)
|
||||||
fun markUnidentified(timestamp: Long, author: String)
|
fun markUnidentified(timestamp: Long, author: String)
|
||||||
fun setErrorMessage(timestamp: Long, author: String, error: Exception)
|
fun setErrorMessage(timestamp: Long, author: String, error: Exception)
|
||||||
|
@ -33,8 +33,8 @@ data class OpenGroupMessage(
|
|||||||
val quote = message.quote
|
val quote = message.quote
|
||||||
if (quote != null && quote.isValid()) {
|
if (quote != null && quote.isValid()) {
|
||||||
val quotedMessageBody = quote.text ?: quote.timestamp!!.toString()
|
val quotedMessageBody = quote.text ?: quote.timestamp!!.toString()
|
||||||
// FIXME: For some reason the server always returns a 500 if quotedMessageServerID is set...
|
val serverID = storage.getQuoteServerID(quote.timestamp!!, quote.publicKey!!)
|
||||||
Quote(quote.timestamp!!, quote.publicKey!!, quotedMessageBody, null)
|
Quote(quote.timestamp!!, quote.publicKey!!, quotedMessageBody, serverID)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user