By voicechat link open the channel as well.
This commit is contained in:
parent
2b3469ef22
commit
4d24f28fd0
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue