Pass room through the model, not when creating the delegate
This is another thing that enables us to view multiple rooms in a single timeline. Specifically, this improves the experience in room search going across room versions and getting a correct readOnly status (for hiding certain hover actions.)
This commit is contained in:
@@ -326,6 +326,10 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
|
||||
return event.value().get().matrixType();
|
||||
}
|
||||
|
||||
if (role == RoomRole) {
|
||||
return QVariant::fromValue(eventRoom);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -356,6 +360,7 @@ QHash<int, QByteArray> MessageModel::roleNames() const
|
||||
roles[IsEditableRole] = "isEditable";
|
||||
roles[ShowAuthorRole] = "showAuthor";
|
||||
roles[EventTypeRole] = "eventType";
|
||||
roles[RoomRole] = "room";
|
||||
return roles;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user