rename vars, compare content status id for reply

This commit is contained in:
sk 2023-10-15 18:10:57 +02:00
parent 9a985aad29
commit 30a4d0efd9
1 changed files with 8 additions and 8 deletions

View File

@ -209,20 +209,20 @@ public abstract class StatusListFragment extends BaseStatusListFragment<Status>
} }
protected void removeStatus(Status status){ protected void removeStatus(Status status){
Status contentStatus=status.getContentStatus(); Status removeStatus=status.getContentStatus();
String id=contentStatus.id; String removeId=removeStatus.id;
iterateRemoveStatus(data, id); iterateRemoveStatus(data, removeId);
iterateRemoveStatus(preloadedData, id); iterateRemoveStatus(preloadedData, removeId);
int ancestorFirstIndex=-1, ancestorLastIndex=-1; int ancestorFirstIndex=-1, ancestorLastIndex=-1;
int offset=0; int offset=0;
for(int i=0;i<displayItems.size();i++){ for(int i=0;i<displayItems.size();i++){
StatusDisplayItem item = displayItems.get(i); StatusDisplayItem item=displayItems.get(i);
if(id.equals(item.contentStatusID)){ if(Objects.equals(item.contentStatusID, removeId)){
offset+=removeStatusDisplayItems(contentStatus, i, ancestorFirstIndex, ancestorLastIndex, offset); offset+=removeStatusDisplayItems(removeStatus, i, ancestorFirstIndex, ancestorLastIndex, offset);
ancestorFirstIndex=ancestorLastIndex=-1; ancestorFirstIndex=ancestorLastIndex=-1;
continue; continue;
} }
if(item.parentID.equals(status.inReplyToId)){ if(Objects.equals(item.contentStatusID, removeStatus.inReplyToId)){
if(ancestorFirstIndex==-1) ancestorFirstIndex=i; if(ancestorFirstIndex==-1) ancestorFirstIndex=i;
ancestorLastIndex=i; ancestorLastIndex=i;
} }