Skip to content

Commit

Permalink
Merge pull request #406
Browse files Browse the repository at this point in the history
fix(ThreadFragment): pass correct account to ComposeView
  • Loading branch information
LucasGGamerM authored May 18, 2024
2 parents 892ce13 + 1ccf9bf commit 1d405d9
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public void onViewCreated(View view, Bundle savedInstanceState){
UiUtils.loadCustomEmojiInTextView(replyButtonText);
replyButtonAva.setOutlineProvider(OutlineProviders.OVAL);
replyButtonAva.setClipToOutline(true);
replyButton.setOnClickListener(v->openReply());
replyButton.setOnClickListener(v->openReply(mainStatus, accountID));
replyButton.setOnLongClickListener(this::onReplyLongClick);
Account self=AccountSessionManager.get(accountID).self;
if(!TextUtils.isEmpty(self.avatar)){
Expand Down Expand Up @@ -570,11 +570,11 @@ public void onApplyWindowInsets(WindowInsets insets){
super.onApplyWindowInsets(UiUtils.applyBottomInsetToFixedView(replyContainer, insets));
}

private void openReply(){
maybeShowPreReplySheet(mainStatus, ()->{
private void openReply(Status status, String accountID){
maybeShowPreReplySheet(status, ()->{
Bundle args=new Bundle();
args.putString("account", accountID);
args.putParcelable("replyTo", Parcels.wrap(mainStatus));
args.putParcelable("replyTo", Parcels.wrap(status));
args.putBoolean("fromThreadFragment", true);
Nav.go(getActivity(), ComposeFragment.class, args);
});
Expand All @@ -583,9 +583,10 @@ private boolean onReplyLongClick(View v) {
if(mainStatus.preview) return false;
if (AccountSessionManager.getInstance().getLoggedInAccounts().size() < 2) return false;
UiUtils.pickAccount(v.getContext(), accountID, R.string.sk_reply_as, R.drawable.ic_fluent_arrow_reply_28_regular, session -> {
UiUtils.lookupStatus(v.getContext(), mainStatus, accountID, session.getID(), status -> {
String pickedAccountID = session.getID();
UiUtils.lookupStatus(v.getContext(), mainStatus, pickedAccountID, accountID, status -> {
if (status == null) return;
openReply();
openReply(status, pickedAccountID);
});
}, null);
return true;
Expand Down

0 comments on commit 1d405d9

Please sign in to comment.