mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-18 12:40:46 +01:00
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)
|
markThreadMessagesUnread(threadId)
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
finish()
|
finish()
|
||||||
|
bus?.post(Events.RefreshMessages())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
private fun getThreadItems(): ArrayList<ThreadItem> {
|
private fun getThreadItems(): ArrayList<ThreadItem> {
|
||||||
|
val items = ArrayList<ThreadItem>()
|
||||||
|
if (isFinishing) {
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
|
||||||
messages.sortBy { it.date }
|
messages.sortBy { it.date }
|
||||||
|
|
||||||
val subscriptionIdToSimId = HashMap<Int, String>()
|
val subscriptionIdToSimId = HashMap<Int, String>()
|
||||||
@ -413,7 +419,6 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
subscriptionIdToSimId[subscriptionInfo.subscriptionId] = "${index + 1}"
|
subscriptionIdToSimId[subscriptionInfo.subscriptionId] = "${index + 1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
val items = ArrayList<ThreadItem>()
|
|
||||||
var prevDateTime = 0
|
var prevDateTime = 0
|
||||||
var hadUnreadItems = false
|
var hadUnreadItems = false
|
||||||
messages.forEach {
|
messages.forEach {
|
||||||
|
@ -229,7 +229,6 @@ fun Context.getConversations(threadId: Long? = null): ArrayList<Conversation> {
|
|||||||
val isGroupConversation = phoneNumbers.size > 1
|
val isGroupConversation = phoneNumbers.size > 1
|
||||||
val read = cursor.getIntValue(Threads.READ) == 1
|
val read = cursor.getIntValue(Threads.READ) == 1
|
||||||
val conversation = Conversation(null, id, snippet, date.toInt(), read, title, photoUri, isGroupConversation, phoneNumbers.first())
|
val conversation = Conversation(null, id, snippet, date.toInt(), read, title, photoUri, isGroupConversation, phoneNumbers.first())
|
||||||
|
|
||||||
conversations.add(conversation)
|
conversations.add(conversation)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user