Highlight reactions sent by local user.

This commit is contained in:
Black Hat
2019-07-21 21:08:37 +08:00
parent 1de54e0ec1
commit cf9a542f74
2 changed files with 5 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ RowLayout {
background: Rectangle {
radius: height / 2
color: MPalette.banner
color: modelData.hasLocalUser ? (MSettings.darkTheme ? Qt.darker(MPalette.accent, 1.55) : Qt.lighter(MPalette.accent, 1.55)) : MPalette.banner
}
contentItem: Label {

View File

@@ -500,9 +500,12 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const {
for (auto author : i.value()) {
authors.append(QVariant::fromValue(author));
}
bool hasLocalUser = i.value().contains(
static_cast<SpectralUser*>(m_currentRoom->localUser()));
res.append(QVariantMap{{"reaction", i.key()},
{"count", i.value().count()},
{"authors", authors}});
{"authors", authors},
{"hasLocalUser", hasLocalUser}});
++i;
}