fix(core/export_chat_messages): no database cache

This commit is contained in:
rhunk 2024-01-04 23:26:55 +01:00
parent a90f4875a7
commit 477b13d3eb
2 changed files with 3 additions and 3 deletions

View File

@ -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()

View File

@ -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 = ?",