Switch to newDisplayName() and newAvatarUrl()

Removes build warnings that these are deprecated.
See libQuotient commit f4db6988bf2fd71f74ac851557d82c6f65cc89b1
for more details.
This commit is contained in:
Mathew Broady
2020-12-21 10:59:46 +11:00
parent 218f897229
commit a1b66f3aa6

View File

@@ -367,17 +367,17 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
}
QString text {};
if (e.isRename()) {
if (e.displayName().isEmpty()) {
if (!e.newDisplayName().has_value()) {
text = i18n("cleared their display name");
} else {
text = i18n("changed their display name to %1", e.displayName().toHtmlEscaped());
text = i18n("changed their display name to %1", e.newDisplayName()->toHtmlEscaped());
}
}
if (e.isAvatarUpdate()) {
if (!text.isEmpty()) {
text += i18n(" and ");
}
if (e.avatarUrl().isEmpty()) {
if (!e.newAvatarUrl().has_value()) {
text += i18n("cleared their avatar");
} else if (e.prevContent()->avatarUrl) {
text += i18n("set an avatar");