diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index 754b8f88a..28aabd409 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -106,6 +106,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana private String visibility; private app.fedilab.android.client.entities.api.Account accountMention; private String statusReplyId; + private app.fedilab.android.client.entities.api.Account mentionBooster; private final BroadcastReceiver imageReceiver = new BroadcastReceiver() { @Override @@ -157,6 +158,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana instance = b.getString(Helper.ARG_INSTANCE, null); token = b.getString(Helper.ARG_TOKEN, null); visibility = b.getString(Helper.ARG_VISIBILITY, null); + mentionBooster = (app.fedilab.android.client.entities.api.Account) b.getSerializable(Helper.ARG_MENTION_BOOSTER); accountMention = (app.fedilab.android.client.entities.api.Account) b.getSerializable(Helper.ARG_ACCOUNT_MENTION); } binding.toolbar.setPopupTheme(Helper.popupStyle()); @@ -266,6 +268,21 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } } } + if (mentionBooster != null) { + Mention mention = new Mention(); + mention.acct = mentionBooster.acct; + mention.url = mentionBooster.url; + mention.username = mentionBooster.username; + boolean present = false; + for (Mention mentionTmp : statusDraftList.get(0).mentions) { + if (mentionTmp.acct.equalsIgnoreCase(mentionBooster.acct)) { + present = true; + } + } + if (!present) { + statusDraftList.get(0).mentions.add(mention); + } + } if (statusReply.spoiler_text != null) { statusDraftList.get(0).spoiler_text = statusReply.spoiler_text; } diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java index d063855e8..04599fbba 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -188,6 +188,7 @@ public class Helper { public static final String ARG_STATUS_DRAFT_ID = "ARG_STATUS_DRAFT_ID"; public static final String ARG_STATUS_REPLY = "ARG_STATUS_REPLY"; + public static final String ARG_MENTION_BOOSTER = "ARG_MENTION_BOOSTER"; public static final String ARG_STATUS_REPLY_ID = "ARG_STATUS_REPLY_ID"; public static final String ARG_ACCOUNT = "ARG_ACCOUNT"; public static final String ARG_ACCOUNT_MENTION = "ARG_ACCOUNT_MENTION"; diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 1e5a734db..2713cb55f 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -1566,6 +1566,9 @@ public class StatusAdapter extends RecyclerView.Adapter } else { Intent intent = new Intent(context, ComposeActivity.class); intent.putExtra(Helper.ARG_STATUS_REPLY, statusToDeal); + if (status.reblog != null) { + intent.putExtra(Helper.ARG_MENTION_BOOSTER, status.account); + } context.startActivity(intent); } });