mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Pass context chat from one webview to another.
This commit is contained in:
@@ -38,6 +38,7 @@ class SessionController;
|
||||
class PeerData;
|
||||
struct ClickHandlerContext {
|
||||
FullMsgId itemId;
|
||||
QString attachBotWebviewUrl;
|
||||
// Is filled from sections.
|
||||
Fn<HistoryView::ElementDelegate*()> elementDelegate;
|
||||
base::weak_ptr<Window::SessionController> sessionWindow;
|
||||
|
@@ -447,6 +447,7 @@ bool ResolveUsernameOrPhone(
|
||||
? std::make_optional(params.value(u"voicechat"_q))
|
||||
: std::nullopt),
|
||||
.clickFromMessageId = myContext.itemId,
|
||||
.clickFromAttachBotWebviewUrl = myContext.attachBotWebviewUrl,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@@ -473,7 +474,7 @@ bool ResolvePrivatePost(
|
||||
if (!channelId || (msgId && !IsServerMsgId(msgId))) {
|
||||
return false;
|
||||
}
|
||||
const auto fromMessageId = context.value<ClickHandlerContext>().itemId;
|
||||
const auto my = context.value<ClickHandlerContext>();
|
||||
using Navigation = Window::SessionNavigation;
|
||||
controller->showPeerByLink(Navigation::PeerByLinkInfo{
|
||||
.usernameOrId = channelId,
|
||||
@@ -487,7 +488,8 @@ bool ResolvePrivatePost(
|
||||
Navigation::ThreadId{ threadId }
|
||||
}
|
||||
: Navigation::RepliesByLinkInfo{ v::null },
|
||||
.clickFromMessageId = fromMessageId,
|
||||
.clickFromMessageId = my.itemId,
|
||||
.clickFromAttachBotWebviewUrl = my.attachBotWebviewUrl,
|
||||
});
|
||||
controller->window().activate();
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user