diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index 30e38ebe25..deb0016139 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -465,12 +465,12 @@ protected boolean needDividerForExtraItem(View child, View bottomSibling, Recycl public abstract void onItemClick(String id); - protected void updatePoll(String parentID, Status statusForContent, Poll poll){ - statusForContent.poll=poll; + protected void updatePoll(String itemID, Status status, Poll poll){ + status.poll=poll; int firstOptionIndex=-1, footerIndex=-1; int i=0; for(StatusDisplayItem item:displayItems){ - if(item.getContentID().equals(statusForContent.id)){ + if(item.parentID.equals(itemID)){ if(item instanceof PollOptionStatusDisplayItem && firstOptionIndex==-1){ firstOptionIndex=i; }else if(item instanceof PollFooterStatusDisplayItem){ @@ -485,7 +485,7 @@ protected void updatePoll(String parentID, Status statusForContent, Poll poll){ List pollItems=displayItems.subList(firstOptionIndex, footerIndex+1); int prevSize=pollItems.size(); pollItems.clear(); - StatusDisplayItem.buildPollItems(parentID, this, poll, pollItems); + StatusDisplayItem.buildPollItems(itemID, this, poll, pollItems); if(prevSize!=pollItems.size()){ adapter.notifyItemRangeRemoved(firstOptionIndex, prevSize); adapter.notifyItemRangeInserted(firstOptionIndex, pollItems.size());