From 46518853ff16f9154ddf9372a8c95bda23a4d32e Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Sun, 12 Aug 2018 20:19:44 +0200 Subject: [PATCH] fix bug where unmuting would unmute wrong account --- .../java/com/keylesspalace/tusky/adapter/MutesAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java index b3c780d3..a2318a74 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java @@ -46,7 +46,7 @@ public class MutesAdapter extends AccountAdapter { if (position < accountList.size()) { MutedUserViewHolder holder = (MutedUserViewHolder) viewHolder; holder.setupWithAccount(accountList.get(position)); - holder.setupActionListener(accountActionListener, position); + holder.setupActionListener(accountActionListener); } else { FooterViewHolder holder = (FooterViewHolder) viewHolder; holder.setState(footerState); @@ -90,8 +90,8 @@ public class MutesAdapter extends AccountAdapter { .into(avatar); } - void setupActionListener(final AccountActionListener listener, final int position) { - unmute.setOnClickListener(v -> listener.onMute(false, id, position)); + void setupActionListener(final AccountActionListener listener) { + unmute.setOnClickListener(v -> listener.onMute(false, id, getAdapterPosition())); avatar.setOnClickListener(v -> listener.onViewAccount(id)); } }