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:
Cody Henthorne
2023-07-20 13:50:32 -04:00
committed by GitHub
parent 744f74b498
commit ec25831a37
21 changed files with 128 additions and 56 deletions

View File

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

View File

@@ -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,