Repository navigation
feat(chat): backoffice list of the restrictions reaching a room - #262
Merged
Merged
Conversation
okapitula
added this pull request to stack #266
October 6, 2026 07:27
okapitula
marked this pull request as ready for review
October 6, 2026 07:28
okapitula
requested review from
damianrzepka,
jakubfilinger-b,
klaudia-blazyczek-blurify,
marek-chmielowski-blurify,
mp-blurify and
zaxovaiko
as code owners
October 6, 2026 07:28
okapitula
force-pushed
the
feat/chat-restricted-players
branch
from
October 7, 2026 12:31
07dbc7f to
2656cad
Compare
okapitula
force-pushed
the
feat/chat-restricted-players
branch
2 times, most recently
from
October 8, 2026 09:42
23c6ffb to
e84f9bf
Compare
zaxovaiko
approved these changes
Oct 9, 2026
okapitula
force-pushed
the
feat/chat-restricted-players
branch
from
October 9, 2026 12:03
e84f9bf to
7dc1732
Compare
zaxovaiko
previously approved these changes
Oct 9, 2026
zaxovaiko
left a comment
Member
There was a problem hiding this comment.
Looks good. One to check later: the restricted-players lookup does not filter isPublic, so an admin with chat-moderation view can list private room bans/mutes.
github-merge-queue
Bot
removed this pull request from the merge queue because a pull request earlier in the stack was removed
Oct 9, 2026
zaxovaiko
force-pushed
the
feat/chat-restricted-players
branch
from
October 9, 2026 17:36
7dc1732 to
9eba680
Compare
adminListRoomRestrictions returns the active mutes, bans and cooldowns that
reach one room, paginated in SQL and newest first, with who set each entry.
Wide-scope rows count when platformScopesFor(roomReach(room)) covers them;
room-moderator mutes and bans report source 'room'.
- GET /backoffice/chat/rooms/{roomId}/restrictions, guarded by
chat-moderation:view, 404 for an unknown or deleted room
- one UNION ALL over the five restriction tables plus a count
- partial (room_id, expires_at) and (scope, expires_at) indexes on active
chat_mute, chat_platform_ban and chat_player_cooldown rows
…ts at
Room-moderator rows resolve the setter's player username and staff rows the account name, so an id that also matches the other table no longer picks the wrong one. The row type is inferred from the union query, and setBy { id, name } becomes setByName so staff ids are not exposed.
zaxovaiko
force-pushed
the
feat/chat-restricted-players
branch
from
October 9, 2026 17:50
9eba680 to
7d8f674
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
adminListRoomRestrictions(GET /backoffice/chat/rooms/{roomId}/restrictions): the active mutes, bans and cooldowns that reach one room, paginated and newest first, with who set each one. Stacks on #261 (base branchfeat/chat-player-restrictions), which stacks on #260.Why
The admin mute, ban and cooldown lists filter by user only. Without a filter they return every active row on the platform, unpaginated, and say neither who set an entry nor the player's username. Which wide scopes reach a room depends on the room kind (
platformScopesFor(roomReach(room))), and room-moderator mutes and bans live in their own tables, so a consumer cannot build a per-room view from the existing routes without re-implementing core's reach rules. Every operator running the backoffice needs to see who is restricted in a room.UNION ALLoverchat_mute,chat_platform_ban,chat_player_cooldown,chat_room_muteandchat_room_ban, plus a count, paginated in SQL withidas the tiebreak.typefilters tomute,banorcooldown.source(adminfor staff rows,roomfor room-moderator rows),scope,roomId,reason(null for a room-moderator ban),setByName(the player username for room rows, the staff account name for admin rows, null if not found),cooldownSeconds(null unless a cooldown),createdAtandexpiresAt.chat-moderation:view, like the existing lists. An unknown or deleted room returns 404; the global room is addressed by its row id or__global.(room_id, expires_at)and(scope, expires_at)wherelifted_at IS NULLfor the three admin tables, so expired history does not slow the listing.Alternatives considered
roomIdfilter on the existing mute and ban lists: it would miss wide-scope rows that reach the room and the room-moderator tables.CHAT_MODERATIONport: the port has no per-room query, and adding one widens an overridable port. This reads core's tables directly, like the other admin room routes.Risks
CHAT_MODERATIONto store mutes, bans or cooldowns elsewhere gets an incomplete list from this route.totaland the page come from two queries, so a restriction set or lifted between them can make them disagree by one, as with the room list.0018_chat_restriction_room_indexesonly adds indexes.