Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodebb-plugin-two-way-block

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.

Compatibility

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.

Installation

npm install nodebb-plugin-two-way-block
./nodebb activate nodebb-plugin-two-way-block
./nodebb build && ./nodebb restart

Or via ACP → Extend → Plugins. No configuration needed; users block/unblock from profile pages as usual.

How it works

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

Changes vs. the original (1.x)

  • 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, .length checked).
  • Teaser fallback fails open on errors instead of breaking page rendering; unit test suite added.

Troubleshooting

  • 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.

License

MIT — original work © opliko, v4 rewrite © Yesilkart Forum.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages