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
|
//first fetch the first message
|
||||||
val conversationId = feedEntry.key!!
|
val conversationId = feedEntry.key!!
|
||||||
val conversationName = feedEntry.feedDisplayName ?: feedEntry.friendDisplayName!!.split("|").lastOrNull() ?: "unknown"
|
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 {
|
?.mapNotNull {
|
||||||
context.database.getFriendInfo(it)
|
context.database.getFriendInfo(it)
|
||||||
}?.associateBy { it.userId!! } ?: emptyMap()
|
}?.associateBy { it.userId!! } ?: emptyMap()
|
||||||
|
@ -295,8 +295,8 @@ class DatabaseAccess(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getConversationParticipants(conversationId: String): List<String>? {
|
fun getConversationParticipants(conversationId: String, useCache: Boolean = true): List<String>? {
|
||||||
if (dmOtherParticipantCache[conversationId] != null) return dmOtherParticipantCache[conversationId]?.let { listOf(myUserId, it) }
|
if (dmOtherParticipantCache[conversationId] != null && useCache) return dmOtherParticipantCache[conversationId]?.let { listOf(myUserId, it) }
|
||||||
return useDatabase(DatabaseType.ARROYO)?.performOperation {
|
return useDatabase(DatabaseType.ARROYO)?.performOperation {
|
||||||
safeRawQuery(
|
safeRawQuery(
|
||||||
"SELECT user_id, conversation_type FROM user_conversation WHERE client_conversation_id = ?",
|
"SELECT user_id, conversation_type FROM user_conversation WHERE client_conversation_id = ?",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user