Fix issue #112 - Cross-account replies broken

pull/254/head
Thomas 2 years ago
parent 2f716b9b11
commit 33b589f4a3

@ -129,8 +129,8 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
statusReplyId = b.getString(Helper.ARG_STATUS_REPLY_ID); statusReplyId = b.getString(Helper.ARG_STATUS_REPLY_ID);
statusMention = (Status) b.getSerializable(Helper.ARG_STATUS_MENTION); statusMention = (Status) b.getSerializable(Helper.ARG_STATUS_MENTION);
account = (Account) b.getSerializable(Helper.ARG_ACCOUNT); account = (Account) b.getSerializable(Helper.ARG_ACCOUNT);
instance = b.getString(Helper.ARG_INSTANCE, BaseMainActivity.currentInstance); instance = b.getString(Helper.ARG_INSTANCE, null);
token = b.getString(Helper.ARG_TOKEN, BaseMainActivity.currentToken); token = b.getString(Helper.ARG_TOKEN, null);
visibility = b.getString(Helper.ARG_VISIBILITY, null); visibility = b.getString(Helper.ARG_VISIBILITY, null);
accountMention = (app.fedilab.android.client.entities.api.Account) b.getSerializable(Helper.ARG_ACCOUNT_MENTION); accountMention = (app.fedilab.android.client.entities.api.Account) b.getSerializable(Helper.ARG_ACCOUNT_MENTION);
} }
@ -159,15 +159,16 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
status.visibility = scheduledStatus.params.visibility; status.visibility = scheduledStatus.params.visibility;
statusDraft.statusDraftList = statuses; statusDraft.statusDraftList = statuses;
} }
if (account == null) {
account = BaseMainActivity.accountWeakReference.get();
}
if (instance == null) { if (instance == null) {
instance = BaseMainActivity.currentInstance; instance = account.instance;
} }
if (token == null) { if (token == null) {
token = BaseMainActivity.currentToken; token = account.token;
}
if (account == null) {
account = BaseMainActivity.accountWeakReference.get();
} }
StatusesVM statusesVM = new ViewModelProvider(ComposeActivity.this).get(StatusesVM.class); StatusesVM statusesVM = new ViewModelProvider(ComposeActivity.this).get(StatusesVM.class);
//Empty compose //Empty compose
List<Status> statusDraftList = new ArrayList<>(); List<Status> statusDraftList = new ArrayList<>();
@ -546,6 +547,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
statusDraft.statusDraftList = statusDrafts; statusDraft.statusDraftList = statusDrafts;
statusDraft.instance = account.instance; statusDraft.instance = account.instance;
statusDraft.user_id = account.user_id; statusDraft.user_id = account.user_id;
if (!canBeSent(statusDraft)) { if (!canBeSent(statusDraft)) {
return; return;
} }

Loading…
Cancel
Save