Skip to content

Commit

Permalink
hide archivedFilterChip when capability is not available
Browse files Browse the repository at this point in the history
Otherwise it would be shown for older NC versions without to be useful

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
  • Loading branch information
mahibi committed Nov 8, 2024
1 parent 1d85963 commit 4991bb8
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import com.nextcloud.talk.conversationlist.ConversationsListActivity
import com.nextcloud.talk.databinding.DialogFilterConversationBinding
import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.talk.users.UserManager
import com.nextcloud.talk.utils.CapabilitiesUtil.hasSpreedFeatureCapability
import com.nextcloud.talk.utils.SpreedFeatures
import com.nextcloud.talk.utils.UserIdUtils
import javax.inject.Inject

Expand Down Expand Up @@ -104,7 +106,14 @@ class FilterConversationFragment : DialogFragment() {
private fun setUpChips() {
binding.unreadFilterChip.isChecked = filterState[UNREAD]!!
binding.mentionedFilterChip.isChecked = filterState[MENTION]!!
binding.archivedFilterChip.isChecked = filterState[ARCHIVE]!!

binding.archivedFilterChip.visibility = View.GONE
userManager.currentUser.blockingGet().capabilities?.spreedCapability?.let {
if (hasSpreedFeatureCapability(it, SpreedFeatures.ARCHIVE_CONVERSATIONS)) {
binding.archivedFilterChip.visibility = View.VISIBLE
binding.archivedFilterChip.isChecked = filterState[ARCHIVE]!!
}
}
}

private fun processSubmit() {
Expand Down

0 comments on commit 4991bb8

Please sign in to comment.