mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Support t.me/+phonenumber links.
This commit is contained in:
@@ -914,6 +914,18 @@ void Session::unregisterInvitedToCallUser(
|
||||
}
|
||||
}
|
||||
|
||||
UserData *Session::userByPhone(const QString &phone) const {
|
||||
const auto pname = phone.trimmed();
|
||||
for (const auto &[peerId, peer] : _peers) {
|
||||
if (const auto user = peer->asUser()) {
|
||||
if (user->phone() == pname) {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PeerData *Session::peerByUsername(const QString &username) const {
|
||||
const auto uname = username.trimmed();
|
||||
for (const auto &[peerId, peer] : _peers) {
|
||||
|
Reference in New Issue
Block a user