Don't show banned user as sender for state events
BUG: 461158
This commit is contained in:
@@ -842,7 +842,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (role == AuthorDisplayNameRole) {
|
if (role == AuthorDisplayNameRole) {
|
||||||
if (!evt.unsignedJson()["prev_content"]["displayname"].isNull()) {
|
if (is<RoomMemberEvent>(evt) && !evt.unsignedJson()["prev_content"]["displayname"].isNull() && evt.stateKey() == evt.senderId()) {
|
||||||
auto previousDisplayName = evt.unsignedJson()["prev_content"]["displayname"].toString().toHtmlEscaped();
|
auto previousDisplayName = evt.unsignedJson()["prev_content"]["displayname"].toString().toHtmlEscaped();
|
||||||
if (previousDisplayName.isEmpty()) {
|
if (previousDisplayName.isEmpty()) {
|
||||||
previousDisplayName = evt.senderId();
|
previousDisplayName = evt.senderId();
|
||||||
@@ -850,7 +850,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
|||||||
return previousDisplayName;
|
return previousDisplayName;
|
||||||
} else {
|
} else {
|
||||||
auto author = static_cast<NeoChatUser *>(isPending ? m_currentRoom->localUser() : m_currentRoom->user(evt.senderId()));
|
auto author = static_cast<NeoChatUser *>(isPending ? m_currentRoom->localUser() : m_currentRoom->user(evt.senderId()));
|
||||||
m_currentRoom->htmlSafeMemberName(author->id());
|
return m_currentRoom->htmlSafeMemberName(author->id());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user