fix a glitch at marking a conversation unread

This commit is contained in:
tibbi 2020-06-18 11:38:27 +02:00
parent 838db92fee
commit 3c1458b904
2 changed files with 6 additions and 2 deletions

View File

@ -399,12 +399,18 @@ class ThreadActivity : SimpleActivity() {
markThreadMessagesUnread(threadId)
runOnUiThread {
finish()
bus?.post(Events.RefreshMessages())
}
}
}
@SuppressLint("MissingPermission")
private fun getThreadItems(): ArrayList<ThreadItem> {
val items = ArrayList<ThreadItem>()
if (isFinishing) {
return items
}
messages.sortBy { it.date }
val subscriptionIdToSimId = HashMap<Int, String>()
@ -413,7 +419,6 @@ class ThreadActivity : SimpleActivity() {
subscriptionIdToSimId[subscriptionInfo.subscriptionId] = "${index + 1}"
}
val items = ArrayList<ThreadItem>()
var prevDateTime = 0
var hadUnreadItems = false
messages.forEach {

View File

@ -229,7 +229,6 @@ fun Context.getConversations(threadId: Long? = null): ArrayList<Conversation> {
val isGroupConversation = phoneNumbers.size > 1
val read = cursor.getIntValue(Threads.READ) == 1
val conversation = Conversation(null, id, snippet, date.toInt(), read, title, photoUri, isGroupConversation, phoneNumbers.first())
conversations.add(conversation)
}