mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fixes for CFv2.
- Status bar color being incorrect when entering a screen that changes it and then returning (e.g., Message Details) - Fix crash in enter sends mode - Fix warning about non-closed cursor - Prevent message abandonment (via trim thread) when it's the first in an inactive thread - Fix payment attachment button flashing on attachment keyboard open if payments disabled - Fix reactionDelegate crash - Fix attachment preview (file, mp3, location, etc) not getting cleared on send
This commit is contained in:
@@ -3193,6 +3193,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
return@withinTransaction kotlin.Pair(-1L, null)
|
||||
}
|
||||
|
||||
threads.markAsActiveEarly(threadId)
|
||||
SignalDatabase.mentions.insert(threadId, messageId, mentions)
|
||||
|
||||
val insertedAttachments = SignalDatabase.attachments.insertAttachmentsForMessage(messageId, allAttachments, quoteAttachments)
|
||||
|
||||
@@ -1366,6 +1366,18 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a thread as active prior to an [update] call. Useful when a thread is for sure active but
|
||||
* hasn't had the update call yet. e.g., inserting a message in a new thread.
|
||||
*/
|
||||
fun markAsActiveEarly(threadId: Long) {
|
||||
writableDatabase
|
||||
.update(TABLE_NAME)
|
||||
.values(ACTIVE to 1)
|
||||
.where("$ID = ?", threadId)
|
||||
.run()
|
||||
}
|
||||
|
||||
fun update(threadId: Long, unarchive: Boolean): Boolean {
|
||||
return update(
|
||||
threadId = threadId,
|
||||
|
||||
Reference in New Issue
Block a user