Skip to content

Commit

Permalink
fix(preview-quote-toots): make code nicer, and add the "IS_FOR_QUOTE"…
Browse files Browse the repository at this point in the history
… flag, so it works better
  • Loading branch information
LucasGGamerM committed Jul 4, 2024
1 parent 15f84af commit cfde442
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,13 @@ public void onAddQuoteToStatus(Status status, Status parentStatus) {
i++;
}

int flags= (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS | StatusDisplayItem.FLAG_IS_FOR_QUOTE);
if (GlobalUserPreferences.spectatorMode)
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
if (!GlobalUserPreferences.showMediaPreview)
flags |= StatusDisplayItem.FLAG_NO_MEDIA_PREVIEW;

if (cardIndex!=-1) {
int flags= (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS);
if (GlobalUserPreferences.spectatorMode)
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
if (!GlobalUserPreferences.showMediaPreview)
flags |= StatusDisplayItem.FLAG_NO_MEDIA_PREVIEW;
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, status, accountID, parentStatus, knownAccounts, null, flags);
displayItems.remove(cardIndex);
adapter.notifyItemRemoved(cardIndex);
Expand All @@ -737,11 +738,6 @@ public void onAddQuoteToStatus(Status status, Status parentStatus) {
}

if (textIndex!=-1) {
int flags= (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS);
if (GlobalUserPreferences.spectatorMode)
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
if (!GlobalUserPreferences.showMediaPreview)
flags |= StatusDisplayItem.FLAG_NO_MEDIA_PREVIEW;
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, status, accountID, parentStatus, knownAccounts, null, flags);
displayItems.addAll(textIndex+1, items);
adapter.notifyItemRangeInserted(textIndex+1, items.size());
Expand Down

0 comments on commit cfde442

Please sign in to comment.