Chat adds public channels, threads and direct messages to a forum, wired into the parts of Flarum you already run. A channel bound to a category inherits that category's permissions, mentions arrive through Flarum's own notifications, and a conversation can be quoted straight into a discussion when it turns out to be worth keeping.
It lives in two places at once: a drawer over whatever page you are reading, and a full-screen page when the conversation deserves the whole window. Neither is a mode you have to choose in advance - the drawer follows you across the forum without tearing down what is open.

Channels
Category channels and direct messages sit in one sidebar. A channel can be public, private by invitation, or open to read and restricted to staff for writing - an announcements channel where everyone still reacts. Bind one to a tag and it inherits that tag's viewForum permission, so a channel on a restricted category is restricted by the same rule that already governs the category.

Each channel carries its own settings: threads on or off, channel-wide mentions, auto-join, and who may post.

Threads
Any message can branch. The thread opens beside the channel with a composer of its own, and the root message keeps a strip showing the reply count and the latest line, so a branched conversation is visible from the main stream rather than hidden behind it.

Everything a message can do
Reactions, replies with quoted context, mentions of a person or of the whole channel, edits with a visible history, pins, bookmarks, and attachments. Images open in a viewer rather than a new tab.

Pinned messages get a strip under the header and a panel of their own; bookmarks get a page across every channel.


Discussions in the chat
A channel bound to a category can announce every new discussion started there, posted by the chat's bot - whose name and avatar you set, or which you can replace with a real account.

Going the other way, select a run of messages and quote them into a new discussion. A conversation that outgrew the chat does not have to be retyped.
Moderation
Delete and restore, move messages between channels, and a report queue of the chat's own. Reports carry a reason and the reporter's words, reach administrators as a notification, and close by themselves when the reported message is deleted.

Slow mode sets how long each person waits between messages in a channel - five seconds to calm a room, five minutes to change what the room is for. A separate permission exempts whoever needs to answer without waiting.

Search
Across every channel you can read, or scoped to one.

On a phone
The sidebar and the conversation are separate views rather than adjacent panes.

Administration
Every limit is in the admin panel: message length, rate limiting, retention for channels and for direct messages, upload size, the notification sound, and the chat's name and icon in the header.

Incoming webhooks are Slack-compatible, so anything that already posts to Slack can post to a channel.

Permissions are granular: using the chat at all, starting direct messages, creating and editing channels, uploading, reacting, sending stickers, mentioning a whole channel, starting threads, pinning, reporting, skipping slow mode, and moderating.

Installation
composer require ramon/chat
php flarum cache:clear
php flarum assets:publish
Enable it on the Extensions page, then grant Use the chat to the groups that should have it - nothing is granted to Guest, and the /chat routes answer 404 without it.
Realtime
Install flarum/realtime and messages arrive over the websocket. Without it the chat polls, and a conversation still works - just a few seconds behind.
Plays well with
- flarum/tags - category-bound channels
- flarum/gdpr - export and erasure of chat data
- ramon/stickers and ramon/verified - render inside messages the way they do in posts
- ramon/audit - a moderation trail
Credits
Built by Ramon Guilherme. The interaction model owes a lot to Discourse Chat and to Discord.
License
MIT. Bug reports and ideas on the issue tracker.