From 4af8d7d397849d7240099f2096052b3683786d83 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 10 Jun 2023 01:09:20 +0200 Subject: [PATCH] Show some generic message for ACL changes fixes #1476 --- resources/qml/delegates/MessageDelegate.qml | 14 ++++++++++++++ src/timeline/TimelineModel.cpp | 5 +++++ src/timeline/TimelineModel.h | 2 ++ 3 files changed, 21 insertions(+) diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml index 3683ee78..68f65062 100644 --- a/resources/qml/delegates/MessageDelegate.qml +++ b/resources/qml/delegates/MessageDelegate.qml @@ -282,6 +282,20 @@ Item { } + DelegateChoice { + roleValue: MtxEvent.ServerAcl + + NoticeMessage { + body: formatted + isOnlyEmoji: false + isReply: d.isReply + keepFullText: d.keepFullText + isStateEvent: d.isStateEvent + formatted: qsTr("%1 changed which servers are allowed in this room.").arg(d.userName) + } + + } + DelegateChoice { roleValue: MtxEvent.Name diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 6cec615b..22fe63d4 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -216,6 +216,8 @@ qml_mtx_events::toRoomEventType(mtx::events::EventType e) return qml_mtx_events::EventType::Topic; case EventType::RoomTombstone: return qml_mtx_events::EventType::Tombstone; + case EventType::RoomServerAcl: + return qml_mtx_events::EventType::ServerAcl; case EventType::RoomRedaction: return qml_mtx_events::EventType::Redaction; case EventType::RoomPinnedEvents: @@ -334,6 +336,9 @@ qml_mtx_events::fromRoomEventType(qml_mtx_events::EventType t) /// m.room.tombstone case qml_mtx_events::Tombstone: return mtx::events::EventType::RoomTombstone; + /// m.room.server_acl + case qml_mtx_events::ServerAcl: + return mtx::events::EventType::RoomServerAcl; /// m.room.topic case qml_mtx_events::Topic: return mtx::events::EventType::RoomTopic; diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h index d1f04e21..a232b4ee 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h @@ -85,6 +85,8 @@ enum EventType PowerLevels, /// m.room.tombstone Tombstone, + /// m.room.server_acl + ServerAcl, /// m.room.topic Topic, /// m.room.redaction