From 0f5130f692cc491f50e005dd677bcc538423d806 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Fri, 31 Mar 2017 15:47:41 -0400 Subject: [PATCH] Fixes an issue where replying to a reblog doesn't fill in the correct mentions in the composer. Closes #40 --- app/src/main/java/com/keylesspalace/tusky/SFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/SFragment.java b/app/src/main/java/com/keylesspalace/tusky/SFragment.java index 820b77a76..6feacf8f3 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/SFragment.java @@ -64,16 +64,18 @@ public class SFragment extends BaseFragment { protected void reply(Status status) { String inReplyToId = status.getActionableId(); - Status.Mention[] mentions = status.mentions; + Status actionableStatus = status.getActionableStatus(); + String replyVisibility = actionableStatus.getVisibility().toString().toLowerCase(); + Status.Mention[] mentions = actionableStatus.mentions; List mentionedUsernames = new ArrayList<>(); for (Status.Mention mention : mentions) { mentionedUsernames.add(mention.username); } - mentionedUsernames.add(status.account.username); + mentionedUsernames.add(actionableStatus.account.username); mentionedUsernames.remove(loggedInUsername); Intent intent = new Intent(getContext(), ComposeActivity.class); intent.putExtra("in_reply_to_id", inReplyToId); - intent.putExtra("reply_visibility", status.getVisibility().toString().toLowerCase()); + intent.putExtra("reply_visibility", replyVisibility); intent.putExtra("mentioned_usernames", mentionedUsernames.toArray(new String[0])); startActivity(intent); }