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){
Status contentStatus=status.getContentStatus();
String id=contentStatus.id;
iterateRemoveStatus(data, id);
iterateRemoveStatus(preloadedData, id);
Status removeStatus=status.getContentStatus();
String removeId=removeStatus.id;
iterateRemoveStatus(data, removeId);
iterateRemoveStatus(preloadedData, removeId);
int ancestorFirstIndex=-1, ancestorLastIndex=-1;
int offset=0;
for(int i=0;i<displayItems.size();i++){
StatusDisplayItem item = displayItems.get(i);
if(id.equals(item.contentStatusID)){
offset+=removeStatusDisplayItems(contentStatus, i, ancestorFirstIndex, ancestorLastIndex, offset);
StatusDisplayItem item=displayItems.get(i);
if(Objects.equals(item.contentStatusID, removeId)){
offset+=removeStatusDisplayItems(removeStatus, i, ancestorFirstIndex, ancestorLastIndex, offset);
ancestorFirstIndex=ancestorLastIndex=-1;
continue;
}
if(item.parentID.equals(status.inReplyToId)){
if(Objects.equals(item.contentStatusID, removeStatus.inReplyToId)){
if(ancestorFirstIndex==-1) ancestorFirstIndex=i;
ancestorLastIndex=i;
}