2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

telegram.me links supported in-app and in Windows

This commit is contained in:
John Preston
2014-12-03 16:10:32 +03:00
parent 03c8de6195
commit 27de201bda
25 changed files with 3626 additions and 3093 deletions

View File

@@ -265,11 +265,12 @@ namespace App {
return lang(lng_status_lastseen).replace(qsl("{when}"), when);
}
void feedUsers(const MTPVector<MTPUser> &users) {
UserData *feedUsers(const MTPVector<MTPUser> &users) {
UserData *data;
const QVector<MTPUser> &v(users.c_vector().v);
for (QVector<MTPUser>::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) {
const MTPuser &user(*i);
UserData *data = 0;
data = 0;
bool wasContact = false;
const MTPUserStatus *status = 0;
@@ -389,6 +390,8 @@ namespace App {
if (App::main()) App::main()->peerUpdated(data);
}
return data;
}
void feedChats(const MTPVector<MTPChat> &chats) {
@@ -903,6 +906,15 @@ namespace App {
return ::self;
}
UserData *userByName(const QString &username) {
for (PeersData::const_iterator i = peersData.cbegin(), e = peersData.cend(); i != e; ++i) {
if (!i.value()->chat && !i.value()->asUser()->username.compare(username.trimmed(), Qt::CaseInsensitive)) {
return i.value()->asUser();
}
}
return 0;
}
ChatData *chat(const PeerId &peer) {
PeerData *d = App::peer(peer);
return d->asChat();
@@ -2062,4 +2074,16 @@ namespace App {
}
}
void openUserByName(const QString &username) {
if (App::main()) {
App::main()->openUserByName(username);
}
}
void openLocalUrl(const QString &url) {
if (App::main()) {
App::main()->openLocalUrl(url);
}
}
}