2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 17:15:16 +00:00

search channel by username

This commit is contained in:
John Preston
2015-09-13 22:15:45 +03:00
parent c3270d6b66
commit eaacc1b7e2
4 changed files with 32 additions and 1 deletions

View File

@@ -104,6 +104,8 @@ void PeerData::updateName(const QString &newName, const QString &newNameOrPhone,
if (isUser()) {
asUser()->username = newUsername;
asUser()->setNameOrPhone(newNameOrPhone);
} else if (isChannel()) {
asChannel()->username = newUsername;
}
Names oldNames = names;
@@ -154,6 +156,8 @@ void PeerData::fillNames() {
if (isUser()) {
if (!asUser()->nameOrPhone.isEmpty() && asUser()->nameOrPhone != name) toIndex += ' ' + textAccentFold(asUser()->nameOrPhone);
if (!asUser()->username.isEmpty()) toIndex += ' ' + textAccentFold(asUser()->username);
} else if (isChannel()) {
if (!asChannel()->username.isEmpty()) toIndex += ' ' + textAccentFold(asChannel()->username);
}
if (cRussianLetters().match(toIndex).hasMatch()) {
toIndex += ' ' + translitRusEng(toIndex);