fix a glitch at marking a conversation unread
This commit is contained in:
parent
838db92fee
commit
3c1458b904
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue