Readonly Room
Add readonly property to a room and use it to decide whether to show chatbar, replies and edits BUG: 479590
This commit is contained in:
@@ -114,6 +114,7 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
||||
Q_EMIT parentIdsChanged();
|
||||
Q_EMIT canonicalParentChanged();
|
||||
Q_EMIT joinRuleChanged();
|
||||
Q_EMIT readOnlyChanged();
|
||||
});
|
||||
connect(connection, &Connection::capabilitiesLoaded, this, &NeoChatRoom::maxRoomVersionChanged);
|
||||
connect(this, &Room::changed, this, [this]() {
|
||||
@@ -662,6 +663,11 @@ bool NeoChatRoom::isInvite() const
|
||||
return joinState() == JoinState::Invite;
|
||||
}
|
||||
|
||||
bool NeoChatRoom::readOnly() const
|
||||
{
|
||||
return !canSendEvent("m.room.message"_ls);
|
||||
}
|
||||
|
||||
bool NeoChatRoom::isUserBanned(const QString &user) const
|
||||
{
|
||||
auto roomMemberEvent = currentState().get<RoomMemberEvent>(user);
|
||||
|
||||
Reference in New Issue
Block a user