Skip to content

Commit

Permalink
feat(StatusDisplayItem/Quote): allow quotes to reference themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
FineFindus committed Jul 6, 2024
1 parent 7240070 commit bc8b0e1
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment<?>
if(!statusForContent.mediaAttachments.isEmpty() && statusForContent.poll==null) // add spacing if immediately preceded by attachment
contentItems.add(new DummyStatusDisplayItem(parentID, fragment));
contentItems.addAll(buildItems(fragment, statusForContent.quote, accountID, parentObject, knownAccounts, filterContext, FLAG_NO_FOOTER|FLAG_INSET|FLAG_NO_EMOJI_REACTIONS|FLAG_IS_FOR_QUOTE));
} else {
} else if((flags & FLAG_INSET)==0){
tryAddNonOfficialQuote(statusForContent, fragment, accountID);
}
if(contentItems!=items && statusForContent.spoilerRevealed){
Expand Down Expand Up @@ -431,12 +431,8 @@ private static void tryAddNonOfficialQuote(Status status, BaseStatusListFragment
@Override
public void onSuccess(SearchResults results){
if (!results.statuses.isEmpty()){
Status quote=results.statuses.get(0);
// don't show self-referential quotes
if(!Objects.equals(status.id, results.statuses.get(0).id)){
status.quote=quote;
fragment.updateStatusWithQuote(status);
}
status.quote=results.statuses.get(0);
fragment.updateStatusWithQuote(status);
}
}

Expand Down

0 comments on commit bc8b0e1

Please sign in to comment.