2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

channel creation almost done

This commit is contained in:
John Preston
2015-09-16 16:04:08 +03:00
parent 77a92c62f7
commit 41e7ce11a0
36 changed files with 1958 additions and 428 deletions

View File

@@ -96,7 +96,19 @@ PeerData::PeerData(const PeerId &id) : id(id), lnk(new PeerLink(this))
}
void PeerData::updateName(const QString &newName, const QString &newNameOrPhone, const QString &newUsername) {
if (name == newName && (!isUser() || (asUser()->nameOrPhone == newNameOrPhone && asUser()->username == newUsername)) && nameVersion > 0) return;
if (name == newName && nameVersion > 0) {
if (isUser()) {
if (asUser()->nameOrPhone == newNameOrPhone && asUser()->username == newUsername) {
return;
}
} else if (isChannel()) {
if (asChannel()->username == newUsername) {
return;
}
} else if (isChat()) {
return;
}
}
++nameVersion;
name = newName;