Remove server acl status/summaries from timeline (#32461)

* Remove server acl strings and timeline status/summaries

* Put back server acl string used in room settings
This commit is contained in:
David Langley
2026-02-12 15:40:07 +00:00
committed by GitHub
parent f326814895
commit 838b3624b8
3 changed files with 0 additions and 53 deletions

View File

@@ -345,35 +345,6 @@ function textForGuestAccessEvent(ev: MatrixEvent): (() => string) | null {
}
}
function textForServerACLEvent(ev: MatrixEvent): (() => string) | null {
const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();
const prevContent = ev.getPrevContent();
const current = ev.getContent();
const prev = {
deny: Array.isArray(prevContent.deny) ? prevContent.deny : [],
allow: Array.isArray(prevContent.allow) ? prevContent.allow : [],
allow_ip_literals: prevContent.allow_ip_literals !== false,
};
let getText: () => string;
if (prev.deny.length === 0 && prev.allow.length === 0) {
getText = () => _t("timeline|m.room.server_acl|set", { senderDisplayName });
} else {
getText = () => _t("timeline|m.room.server_acl|changed", { senderDisplayName });
}
if (!Array.isArray(current.allow)) {
current.allow = [];
}
// If we know for sure everyone is banned, mark the room as obliterated
if (current.allow.length === 0) {
return () => getText() + " " + _t("timeline|m.room.server_acl|all_servers_banned");
}
return getText;
}
function textForMessageEvent(ev: MatrixEvent, client: MatrixClient): (() => string) | null {
if (isLocationEvent(ev)) {
return textForLocationEvent(ev);
@@ -909,7 +880,6 @@ const stateHandlers: IHandlers = {
[EventType.RoomHistoryVisibility]: textForHistoryVisibilityEvent,
[EventType.RoomPowerLevels]: textForPowerEvent,
[EventType.RoomPinnedEvents]: textForPinnedEvent,
[EventType.RoomServerAcl]: textForServerACLEvent,
[EventType.RoomTombstone]: textForTombstoneEvent,
[EventType.RoomJoinRules]: textForJoinRulesEvent,
[EventType.RoomGuestAccess]: textForGuestAccessEvent,

View File

@@ -64,7 +64,6 @@ enum TransitionType {
ChangedName = "changed_name",
ChangedAvatar = "changed_avatar",
NoChange = "no_change",
ServerAcl = "server_acl",
ChangedPins = "pinned_messages",
MessageRemoved = "message_removed",
HiddenEvent = "hidden_event",
@@ -441,12 +440,6 @@ export default class EventListSummary extends React.Component<Props, State> {
? _t("timeline|summary|no_change_multiple", { severalUsers: "", count })
: _t("timeline|summary|no_change", { oneUser: "", count });
break;
case TransitionType.ServerAcl:
res =
userCount > 1
? _t("timeline|summary|server_acls_multiple", { severalUsers: "", count })
: _t("timeline|summary|server_acls", { oneUser: "", count });
break;
case TransitionType.ChangedPins:
res =
userCount > 1
@@ -515,9 +508,6 @@ export default class EventListSummary extends React.Component<Props, State> {
}
return TransitionType.Invited;
case EventType.RoomServerAcl:
return TransitionType.ServerAcl;
case EventType.RoomPinnedEvents:
return TransitionType.ChangedPins;

View File

@@ -3533,11 +3533,6 @@
"changed": "%(senderName)s changed the power level of %(powerLevelDiffText)s.",
"user_from_to": "%(userId)s from %(fromPowerLevel)s to %(toPowerLevel)s"
},
"m.room.server_acl": {
"all_servers_banned": "🎉 All servers are banned from participating! This room can no longer be used.",
"changed": "%(senderDisplayName)s changed the server ACLs for this room.",
"set": "%(senderDisplayName)s set the server ACLs for this room."
},
"m.room.third_party_invite": {
"revoked": "%(senderName)s revoked the invitation for %(targetDisplayName)s to join the room.",
"sent": "%(senderName)s sent an invitation to %(targetDisplayName)s to join the room."
@@ -3746,14 +3741,6 @@
"one": "%(severalUsers)sleft and rejoined",
"other": "%(severalUsers)sleft and rejoined %(count)s times"
},
"server_acls": {
"one": "%(oneUser)schanged the server ACLs",
"other": "%(oneUser)schanged the server ACLs %(count)s times"
},
"server_acls_multiple": {
"one": "%(severalUsers)schanged the server ACLs",
"other": "%(severalUsers)schanged the server ACLs %(count)s times"
},
"unbanned": {
"one": "was unbanned",
"other": "was unbanned %(count)s times"