mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 13:00:17 +02:00
fix(core/export_chat_messages): no database cache
This commit is contained in:
parent
a90f4875a7
commit
477b13d3eb
@ -333,7 +333,7 @@ class ExportChatMessages : AbstractAction() {
|
||||
//first fetch the first message
|
||||
val conversationId = feedEntry.key!!
|
||||
val conversationName = feedEntry.feedDisplayName ?: feedEntry.friendDisplayName!!.split("|").lastOrNull() ?: "unknown"
|
||||
val conversationParticipants = context.database.getConversationParticipants(feedEntry.key!!)
|
||||
val conversationParticipants = context.database.getConversationParticipants(feedEntry.key!!, useCache = false)
|
||||
?.mapNotNull {
|
||||
context.database.getFriendInfo(it)
|
||||
}?.associateBy { it.userId!! } ?: emptyMap()
|
||||
|
@ -295,8 +295,8 @@ class DatabaseAccess(
|
||||
}
|
||||
}
|
||||
|
||||
fun getConversationParticipants(conversationId: String): List<String>? {
|
||||
if (dmOtherParticipantCache[conversationId] != null) return dmOtherParticipantCache[conversationId]?.let { listOf(myUserId, it) }
|
||||
fun getConversationParticipants(conversationId: String, useCache: Boolean = true): List<String>? {
|
||||
if (dmOtherParticipantCache[conversationId] != null && useCache) return dmOtherParticipantCache[conversationId]?.let { listOf(myUserId, it) }
|
||||
return useDatabase(DatabaseType.ARROYO)?.performOperation {
|
||||
safeRawQuery(
|
||||
"SELECT user_id, conversation_type FROM user_conversation WHERE client_conversation_id = ?",
|
||||
|
Loading…
x
Reference in New Issue
Block a user