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

Update archive row on chat list name change.

This commit is contained in:
John Preston
2019-04-23 17:28:44 +04:00
parent 9ff02707bf
commit 3dd2a6bb5b
4 changed files with 43 additions and 12 deletions

View File

@@ -115,7 +115,7 @@ void PeerData::updateNameDelayed(
const QString &newName,
const QString &newNameOrPhone,
const QString &newUsername) {
if (name == newName) {
if (name == newName && nameVersion > 1) {
if (isUser()) {
if (asUser()->nameOrPhone == newNameOrPhone
&& asUser()->username == newUsername) {
@@ -129,15 +129,14 @@ void PeerData::updateNameDelayed(
return;
}
}
++nameVersion;
name = newName;
nameText.setText(st::msgNameStyle, name, Ui::NameTextOptions());
refreshEmptyUserpic();
Notify::PeerUpdate update(this);
update.flags |= UpdateFlag::NameChanged;
update.oldNameFirstLetters = nameFirstLetters();
if (nameVersion++ > 1) {
update.flags |= UpdateFlag::NameChanged;
update.oldNameFirstLetters = nameFirstLetters();
}
if (isUser()) {
if (asUser()->username != newUsername) {
asUser()->username = newUsername;
@@ -157,7 +156,9 @@ void PeerData::updateNameDelayed(
}
}
fillNames();
Notify::PeerUpdated().notify(update, true);
if (update.flags) {
Notify::PeerUpdated().notify(update, true);
}
}
std::unique_ptr<Ui::EmptyUserpic> PeerData::createEmptyUserpic() const {