diff --git a/app/src/main/java/com/nextcloud/talk/openconversations/adapters/OpenConversationsAdapter.kt b/app/src/main/java/com/nextcloud/talk/openconversations/adapters/OpenConversationsAdapter.kt index 89da0c002..88416a849 100644 --- a/app/src/main/java/com/nextcloud/talk/openconversations/adapters/OpenConversationsAdapter.kt +++ b/app/src/main/java/com/nextcloud/talk/openconversations/adapters/OpenConversationsAdapter.kt @@ -26,8 +26,6 @@ class OpenConversationsAdapter( private val onClick: (Conversation) -> Unit ) : ListAdapter(ConversationsCallback) { - private var originalList: List = emptyList() - private var isFiltering = false inner class OpenConversationsViewHolder(val itemBinding: RvItemOpenConversationBinding) : RecyclerView.ViewHolder(itemBinding.root) { @@ -78,33 +76,6 @@ class OpenConversationsAdapter( val conversation = getItem(position) holder.bindItem(conversation) } - - fun filter(text: String) { - if (text == "") { - submitList(originalList) - isFiltering = false - return - } - - isFiltering = true - val newList = mutableListOf() - for (conversation in originalList) { - if (conversation.displayName.contains(text, true) || conversation.description!!.contains(text, true)) { - newList.add(conversation) - } - } - - if (newList.isNotEmpty()) { - submitList(newList) - } - } - - override fun onCurrentListChanged(previousList: MutableList, currentList: MutableList) { - if (!isFiltering) { - originalList = currentList - } - super.onCurrentListChanged(previousList, currentList) - } } object ConversationsCallback : DiffUtil.ItemCallback() {