2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

When following a post link push reply-return.

Fixes #4856.
This commit is contained in:
John Preston
2018-07-09 21:13:48 +03:00
parent eb3eef4b80
commit b697824540
25 changed files with 136 additions and 74 deletions

View File

@@ -3695,7 +3695,11 @@ bool MainWidget::started() {
return _started;
}
void MainWidget::openPeerByName(const QString &username, MsgId msgId, const QString &startToken) {
void MainWidget::openPeerByName(
const QString &username,
MsgId msgId,
const QString &startToken,
FullMsgId clickFromMessageId) {
Messenger::Instance().hideMediaView();
PeerData *peer = App::peerByName(username);
@@ -3736,7 +3740,13 @@ void MainWidget::openPeerByName(const QString &username, MsgId msgId, const QStr
_history->updateControlsGeometry();
}
}
InvokeQueued(this, [this, peer, msgId] {
const auto returnToId = clickFromMessageId;
InvokeQueued(this, [=] {
if (const auto returnTo = App::histItemById(returnToId)) {
if (returnTo->history()->peer == peer) {
pushReplyReturn(returnTo);
}
}
_controller->showPeerHistory(
peer->id,
SectionShow::Way::Forward,