Fix display name referenced for incorrect event types

pull/556/head
Joseph Donofry 4 years ago
parent 01ee25cee4
commit a402e85a0f
No known key found for this signature in database
GPG Key ID: E8A1D78EF044B0CB
  1. 7
      src/timeline/TimelineModel.cpp

@ -1463,9 +1463,8 @@ TimelineModel::formatMemberEvent(QString id)
} }
} }
QString user = QString::fromStdString(event->state_key); QString user = QString::fromStdString(event->state_key);
QString name = utils::replaceEmoji(displayName(user)); QString name = utils::replaceEmoji(displayName(user));
QString oldName = QString::fromStdString(prevEvent->content.display_name);
QString rendered; QString rendered;
// see table https://matrix.org/docs/spec/client_server/latest#m-room-member // see table https://matrix.org/docs/spec/client_server/latest#m-room-member
@ -1476,6 +1475,8 @@ TimelineModel::formatMemberEvent(QString id)
break; break;
case Membership::Join: case Membership::Join:
if (prevEvent && prevEvent->content.membership == Membership::Join) { if (prevEvent && prevEvent->content.membership == Membership::Join) {
QString oldName = QString::fromStdString(prevEvent->content.display_name);
bool displayNameChanged = bool displayNameChanged =
prevEvent->content.display_name != event->content.display_name; prevEvent->content.display_name != event->content.display_name;
bool avatarChanged = bool avatarChanged =

Loading…
Cancel
Save