mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-29 13:39:06 +00:00
Added special param to links for peers to resolve them in new window.
This commit is contained in:
parent
507bcbd332
commit
9d36d7119b
@ -708,6 +708,8 @@ bool ResolveUsernameOrPhone(
|
|||||||
: std::nullopt),
|
: std::nullopt),
|
||||||
.clickFromMessageId = myContext.itemId,
|
.clickFromMessageId = myContext.itemId,
|
||||||
.clickFromBotWebviewContext = myContext.botWebviewContext,
|
.clickFromBotWebviewContext = myContext.botWebviewContext,
|
||||||
|
.historyInNewWindow =
|
||||||
|
(params.value(u"tdesktop_target"_q) == u"blank"_q),
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -781,12 +781,26 @@ void SessionNavigation::showPeerByLinkResolved(
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const auto draft = info.text;
|
const auto draft = info.text;
|
||||||
|
const auto historyInNewWindow = info.historyInNewWindow;
|
||||||
params.videoTimestamp = info.videoTimestamp;
|
params.videoTimestamp = info.videoTimestamp;
|
||||||
crl::on_main(this, [=] {
|
crl::on_main(this, [=] {
|
||||||
if (peer->isUser() && !draft.isEmpty()) {
|
if (peer->isUser() && !draft.isEmpty()) {
|
||||||
Data::SetChatLinkDraft(peer, { draft });
|
Data::SetChatLinkDraft(peer, { draft });
|
||||||
}
|
}
|
||||||
showPeerHistory(peer, params, msgId);
|
if (historyInNewWindow) {
|
||||||
|
const auto window
|
||||||
|
= Core::App().ensureSeparateWindowFor(peer);
|
||||||
|
const auto controller = window
|
||||||
|
? window->sessionController()
|
||||||
|
: nullptr;
|
||||||
|
if (controller) {
|
||||||
|
controller->showPeerHistory(peer, params, msgId);
|
||||||
|
} else {
|
||||||
|
showPeerHistory(peer, params, msgId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showPeerHistory(peer, params, msgId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ struct PeerByLinkInfo {
|
|||||||
std::optional<QString> voicechatHash;
|
std::optional<QString> voicechatHash;
|
||||||
FullMsgId clickFromMessageId;
|
FullMsgId clickFromMessageId;
|
||||||
std::shared_ptr<InlineBots::WebViewContext> clickFromBotWebviewContext;
|
std::shared_ptr<InlineBots::WebViewContext> clickFromBotWebviewContext;
|
||||||
|
bool historyInNewWindow = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Window
|
} // namespace Window
|
||||||
|
Loading…
x
Reference in New Issue
Block a user