mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
Move thread handling to unarchiveConversation method
This commit is contained in:
@ -26,7 +26,7 @@ class ArchivedConversationsAdapter(
|
|||||||
|
|
||||||
when (id) {
|
when (id) {
|
||||||
R.id.cab_delete -> askConfirmDelete()
|
R.id.cab_delete -> askConfirmDelete()
|
||||||
R.id.cab_unarchive -> ensureBackgroundThread { unarchiveConversation() }
|
R.id.cab_unarchive -> unarchiveConversation()
|
||||||
R.id.cab_select_all -> selectAll()
|
R.id.cab_select_all -> selectAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,6 +64,7 @@ class ArchivedConversationsAdapter(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensureBackgroundThread {
|
||||||
val conversationsToUnarchive = currentList.filter { selectedKeys.contains(it.hashCode()) } as ArrayList<Conversation>
|
val conversationsToUnarchive = currentList.filter { selectedKeys.contains(it.hashCode()) } as ArrayList<Conversation>
|
||||||
conversationsToUnarchive.forEach {
|
conversationsToUnarchive.forEach {
|
||||||
activity.updateConversationArchivedStatus(it.threadId, false)
|
activity.updateConversationArchivedStatus(it.threadId, false)
|
||||||
@ -71,6 +72,7 @@ class ArchivedConversationsAdapter(
|
|||||||
|
|
||||||
removeConversationsFromList(conversationsToUnarchive)
|
removeConversationsFromList(conversationsToUnarchive)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun removeConversationsFromList(removedConversations: List<Conversation>) {
|
private fun removeConversationsFromList(removedConversations: List<Conversation>) {
|
||||||
val newList = try {
|
val newList = try {
|
||||||
|
Reference in New Issue
Block a user