mod_chat_is_privileged

Gate chat by credential. Part of the bundled plug-ins.

mod_chat_is_privileged restricts who may write in main chat and who may send private messages, using a minimum credential per message type. It is the plug-in counterpart to the built-in chat_is_privileged option, adding private-message control — the usual defence against private-message spam from guests, which the core option does not cover.

Loading

plugin /var/lib/uhub/mod_chat_is_privileged.so "allow_privchat=reg allow_op_contact=guest"

Configuration

Each option is a minimum credential: a user at or above that level is allowed, everyone below is denied and told so once.

OptionDefaultDescription
allow_mainchatguestMinimum credential to write in main chat.
allow_privchatguestMinimum credential to send a private message.
allow_op_contactguestMinimum credential to private-message an operator or above. Applies when the recipient is staff.

Accepted credential names, from least to most privileged:

none, guest, user (also reg), operator (also op), super, admin — plus the bot classes bot, ubot, opbot and opubot.

Behaviour

A denied user is sent a one-time notice per category — one for main chat, one for private messages — so a client that keeps retrying does not spam them with warnings. The message itself is dropped.

allow_op_contact is checked when the recipient is an operator, super or admin, and is normally left at or below allow_privchat. That way ordinary users can always reach staff even while peer-to-peer private messaging is locked down:

# Everyone may read and write main chat.
# Only registered users may PM each other…
# …but anyone may PM an operator to ask for help.
plugin /var/lib/uhub/mod_chat_is_privileged.so "allow_privchat=reg allow_op_contact=guest"

Setting allow_op_contact above allow_privchat is allowed but rarely what you want — it makes staff harder to reach than other users.

Fixed in 0.8.0: earlier versions parsed allow_privchat but never enforced it, so private messages were not actually gated. Hubs that relied on the setting should recheck their configuration now that it takes effect.

To disable file transfers entirely rather than restrict chat, see mod_chat_only.