From 06e49c6813a292d8d9d37585cfeb953115092604 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 21 Jul 2023 18:06:00 +0400 Subject: [PATCH] Fix opening t.me/channel with min-loaded channels. --- Telegram/SourceFiles/data/data_session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index b3911b9d43..73ebae0e1c 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -1158,7 +1158,8 @@ UserData *Session::userByPhone(const QString &phone) const { PeerData *Session::peerByUsername(const QString &username) const { const auto uname = username.trimmed(); for (const auto &[peerId, peer] : _peers) { - if (!peer->userName().compare(uname, Qt::CaseInsensitive)) { + if (peer->isLoaded() + && !peer->userName().compare(uname, Qt::CaseInsensitive)) { return peer.get(); } }