2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix opening t.me/channel with min-loaded channels.

This commit is contained in:
John Preston
2023-07-21 18:06:00 +04:00
parent 30c73fbdf2
commit 06e49c6813

View File

@@ -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();
}
}