Fix issue when opening view-once messages.
This commit is contained in:
parent
d0d4008100
commit
b96a5af133
1 changed files with 5 additions and 4 deletions
|
@ -358,13 +358,13 @@ class AttachmentTable(
|
||||||
return count
|
return count
|
||||||
}
|
}
|
||||||
|
|
||||||
fun deleteAttachmentFilesForViewOnceMessage(mmsId: Long) {
|
fun deleteAttachmentFilesForViewOnceMessage(messageId: Long) {
|
||||||
Log.d(TAG, "[deleteAttachmentFilesForViewOnceMessage] mmsId: $mmsId")
|
Log.d(TAG, "[deleteAttachmentFilesForViewOnceMessage] messageId: $messageId")
|
||||||
|
|
||||||
writableDatabase.withinTransaction { db ->
|
writableDatabase.withinTransaction { db ->
|
||||||
db.select(DATA_FILE, CONTENT_TYPE, ID)
|
db.select(DATA_FILE, CONTENT_TYPE, ID)
|
||||||
.from(TABLE_NAME)
|
.from(TABLE_NAME)
|
||||||
.where("$MESSAGE_ID = ?", mmsId)
|
.where("$MESSAGE_ID = ?", messageId)
|
||||||
.run()
|
.run()
|
||||||
.forEach { cursor ->
|
.forEach { cursor ->
|
||||||
deleteAttachmentOnDisk(
|
deleteAttachmentOnDisk(
|
||||||
|
@ -388,11 +388,12 @@ class AttachmentTable(
|
||||||
BLUR_HASH to null,
|
BLUR_HASH to null,
|
||||||
CONTENT_TYPE to MediaUtil.VIEW_ONCE
|
CONTENT_TYPE to MediaUtil.VIEW_ONCE
|
||||||
)
|
)
|
||||||
|
.where("$MESSAGE_ID = ?", messageId)
|
||||||
.run()
|
.run()
|
||||||
|
|
||||||
notifyAttachmentListeners()
|
notifyAttachmentListeners()
|
||||||
|
|
||||||
val threadId = messages.getThreadIdForMessage(mmsId)
|
val threadId = messages.getThreadIdForMessage(messageId)
|
||||||
if (threadId > 0) {
|
if (threadId > 0) {
|
||||||
notifyConversationListeners(threadId)
|
notifyConversationListeners(threadId)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue