From b621f8f78da8d4025a7d4c6a12d74f6a7f983ace Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Tue, 17 Apr 2018 19:06:28 +0200 Subject: [PATCH] fix bug where sometimes mentions where duplicated when replying --- .../java/com/keylesspalace/tusky/fragment/SFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java index c17a58b2..065fc28b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java @@ -44,8 +44,8 @@ import com.keylesspalace.tusky.interfaces.AdapterItemRemover; import com.keylesspalace.tusky.network.TimelineCases; import com.keylesspalace.tusky.util.HtmlUtils; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedHashSet; +import java.util.Set; /* Note from Andrew on Jan. 22, 2017: This class is a design problem for me, so I left it with an * awkward name. TimelineFragment and NotificationFragment have significant overlap but the nature @@ -89,7 +89,7 @@ public abstract class SFragment extends BaseFragment implements AdapterItemRemov Status.Visibility replyVisibility = actionableStatus.getVisibility(); String contentWarning = actionableStatus.getSpoilerText(); Status.Mention[] mentions = actionableStatus.getMentions(); - List mentionedUsernames = new ArrayList<>(); + Set mentionedUsernames = new LinkedHashSet<>(); mentionedUsernames.add(actionableStatus.getAccount().getUsername()); for (Status.Mention mention : mentions) { mentionedUsernames.add(mention.getUsername());