Skip to content

Commit ec78d3b

Browse files
committed
Added processing of recent self forwards to share box.
1 parent acf61c2 commit ec78d3b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Telegram/SourceFiles/boxes/share_box.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,8 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback(
17331733
const auto donePhraseArgs = CreateForwardedMessagePhraseArgs(
17341734
result,
17351735
msgIds);
1736+
const auto showRecentForwardsToSelf = result.size() == 1
1737+
&& result.front()->peer()->isSelf();
17361738
const auto requestType = Data::Histories::RequestType::Send;
17371739
for (const auto thread : result) {
17381740
if (!comment.text.isEmpty()) {
@@ -1790,6 +1792,13 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback(
17901792
Api::SuggestToMTP(options.suggest)
17911793
)).done([=](const MTPUpdates &updates, mtpRequestId reqId) {
17921794
threadHistory->session().api().applyUpdates(updates);
1795+
if (showRecentForwardsToSelf) {
1796+
ApiWrap::ProcessRecentSelfForwards(
1797+
&threadHistory->session(),
1798+
updates,
1799+
peer->id,
1800+
history->peer->id);
1801+
}
17931802
state->requests.remove(reqId);
17941803
if (state->requests.empty()) {
17951804
if (show->valid()) {

0 commit comments

Comments
 (0)