mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
By voicechat link open the channel as well.
This commit is contained in:
@@ -178,7 +178,19 @@ void SessionNavigation::resolveChannelById(
|
|||||||
void SessionNavigation::showPeerByLinkResolved(
|
void SessionNavigation::showPeerByLinkResolved(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const PeerByLinkInfo &info) {
|
const PeerByLinkInfo &info) {
|
||||||
|
auto params = SectionShow{
|
||||||
|
SectionShow::Way::Forward
|
||||||
|
};
|
||||||
|
params.origin = SectionShow::OriginMessage{
|
||||||
|
info.clickFromMessageId
|
||||||
|
};
|
||||||
if (info.voicechatHash && peer->isChannel()) {
|
if (info.voicechatHash && peer->isChannel()) {
|
||||||
|
// First show the channel itself.
|
||||||
|
crl::on_main(this, [=] {
|
||||||
|
showPeerHistory(peer->id, params, ShowAtUnreadMsgId);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Then try to join the voice chat.
|
||||||
const auto bad = [=] {
|
const auto bad = [=] {
|
||||||
Ui::ShowMultilineToast({
|
Ui::ShowMultilineToast({
|
||||||
.text = { tr::lng_group_invite_bad_link(tr::now) }
|
.text = { tr::lng_group_invite_bad_link(tr::now) }
|
||||||
@@ -224,12 +236,6 @@ void SessionNavigation::showPeerByLinkResolved(
|
|||||||
}).send();
|
}).send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto params = SectionShow{
|
|
||||||
SectionShow::Way::Forward
|
|
||||||
};
|
|
||||||
params.origin = SectionShow::OriginMessage{
|
|
||||||
info.clickFromMessageId
|
|
||||||
};
|
|
||||||
const auto &replies = info.repliesInfo;
|
const auto &replies = info.repliesInfo;
|
||||||
if (const auto threadId = std::get_if<ThreadId>(&replies)) {
|
if (const auto threadId = std::get_if<ThreadId>(&replies)) {
|
||||||
showRepliesForMessage(
|
showRepliesForMessage(
|
||||||
|
Reference in New Issue
Block a user