Update algorithm for history visible banner. (#31577)

* feat: Update algorithm for history visible banner.

- The banner now only shows for rooms with `shared` or `worldReadable`
  history visibility.
- The banner does not show in rooms in which the current user cannot
  send messages.

* tests: Add `getHistoryVisibility` to stub room.

* docs: Add description to `visible` condition check.

* docs: Fix spelling.

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>

* chore: Remove `jest-sonar.xml`.

---------

Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
This commit is contained in:
Skye Elliot
2025-12-19 15:41:09 +00:00
committed by GitHub
parent aa84b2e07c
commit ce9c66ba4c
5 changed files with 91 additions and 17 deletions

View File

@@ -677,6 +677,7 @@ export function mkStubRoom(
getCanonicalAlias: jest.fn(),
getDMInviter: jest.fn(),
getEventReadUpTo: jest.fn(() => null),
getHistoryVisibility: jest.fn().mockReturnValue(HistoryVisibility.Joined),
getInvitedAndJoinedMemberCount: jest.fn().mockReturnValue(1),
getJoinRule: jest.fn().mockReturnValue("invite"),
getJoinedMemberCount: jest.fn().mockReturnValue(1),