Two-way user blocking for NodeBB v4. When user A blocks user B, the block applies in both directions:
- Neither user sees the other's posts, topics, teasers, notifications (including upvotes/likes), or activity.
- Neither user can start a chat with the other, and replies inside existing private chat rooms between them are blocked. Public rooms are exempt.
A modernized rewrite of oplik0/nodebb-plugin-two-way-block (MIT) for NodeBB v4, maintained by Yesilkart Forum.
| NodeBB | Plugin |
|---|---|
| ^4.0.0 | 2.x |
| 1.13.3 – 3.x | use the original plugin 1.x |
Existing data from the original plugin is reused as-is (same uid:<uid>:blocked_by_uids keys) — no migration needed.
npm install nodebb-plugin-two-way-block
./nodebb activate nodebb-plugin-two-way-block
./nodebb build && ./nodebb restartOr via ACP → Extend → Plugins. No configuration needed; users block/unblock from profile pages as usual.
Core NodeBB blocking is one-way (blocker no longer sees the blocked user). This plugin maintains a reverse blocked-by index and hooks it into core:
| Hook | Purpose |
|---|---|
action:user.blocks.add / remove |
Maintain the reverse index |
filter:user.blocks.filter |
Make every core block-filter two-way (posts, topics, notifications, chats list) |
filter:teasers.get |
Swap blocked teasers for the previous visible post |
static:messaging.canMessageUser |
Block sender→recipient chats (core covers the other direction) |
static:messaging.canMessageRoom |
Block replies in private rooms between blocked pairs |
- NodeBB v4 support (
nbbpm.compatibility ^4.0.0); handles ActivityPub (remote) user ids safely. - Chat blocking both ways — new; the original only handled content visibility.
- Fixed a cache bug where the LRU cache never hit (Set stored,
.lengthchecked). - Teaser fallback fails open on errors instead of breaking page rendering; unit test suite added.
- Blocked content still visible after activation: run
./nodebb build && ./nodebb restart. - Chat error message shows a raw token: rebuild languages (
./nodebb build lang). - Old blocks made before this plugin was active are one-way until re-applied (unblock + block again), matching original behavior.
MIT — original work © opliko, v4 rewrite © Yesilkart Forum.