mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
Wire DM block state into the existing disabled-with-reason composer mode (channels-members-dms.md §3.2). A new blocks.store holds two directions: - blockedByMe (from GET /blocks on every ready) -> "You've blocked this user. Unblock to send messages." - blockedByThem (inferred from a refused DM send: ErrBlocked -> FORBIDDEN, cleared on the next ready) -> neutral "You can't message this user right now.", never revealing the block explicitly. ChannelController reads dmComposerBlockReason(recipientId) and subscribes to blocks.store so an unblock (shrunken GET /blocks) re-enables the composer live; blockedByMe takes precedence when both apply. Adds api.listBlocks(), threads an optional api into wireDispatcher, and covers both directions plus un-gating in blocks-store / channel-controller / dispatcher tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>