mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fix thread update with drafts bugs.
* Fix thread not updating correctly when drafts are present. * Fix thread delete bug during first message drafting.
This commit is contained in:
@@ -1327,6 +1327,17 @@ class ThreadDatabase(context: Context, databaseHelper: SignalDatabase) : Databas
|
||||
return true
|
||||
}
|
||||
|
||||
val drafts: DraftDatabase.Drafts = SignalDatabase.drafts.getDrafts(threadId)
|
||||
if (drafts.isNotEmpty()) {
|
||||
val threadRecord: ThreadRecord? = getThreadRecord(threadId)
|
||||
if (threadRecord != null &&
|
||||
threadRecord.type == MmsSmsColumns.Types.BASE_DRAFT_TYPE &&
|
||||
threadRecord.date > record.timestamp
|
||||
) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
updateThread(
|
||||
threadId = threadId,
|
||||
meaningfulMessages = meaningfulMessages,
|
||||
|
||||
Reference in New Issue
Block a user