Added processing of recent self forwards to share box.

This commit is contained in:
23rd
2025-10-07 19:34:27 +03:00
parent acf61c24bd
commit ec78d3b83b
+9
View File
@@ -1733,6 +1733,8 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback(
const auto donePhraseArgs = CreateForwardedMessagePhraseArgs(
result,
msgIds);
const auto showRecentForwardsToSelf = result.size() == 1
&& result.front()->peer()->isSelf();
const auto requestType = Data::Histories::RequestType::Send;
for (const auto thread : result) {
if (!comment.text.isEmpty()) {
@@ -1790,6 +1792,13 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback(
Api::SuggestToMTP(options.suggest)
)).done([=](const MTPUpdates &updates, mtpRequestId reqId) {
threadHistory->session().api().applyUpdates(updates);
if (showRecentForwardsToSelf) {
ApiWrap::ProcessRecentSelfForwards(
&threadHistory->session(),
updates,
peer->id,
history->peer->id);
}
state->requests.remove(reqId);
if (state->requests.empty()) {
if (show->valid()) {