Disclaimer: This project was built with the guidance of a human developer and implemented primarily by Claude Code (Anthropic's AI coding assistant). I didn't have time to dev all of this by hand myself, but did have enough to guide Claude to do so! If LLM-assisted development is something you actively avoid, consider this your fair warning.
Adds a /ric slash command to Mattermost that lets you reply to a thread inline in the channel — similar to Slack's "Also send to channel" feature. Works on all platforms including web, desktop, iOS, and Android.
When you run /ric your message from within a thread, the plugin:
- Posts a formatted reply in the channel with a quote of the thread's root message and a clickable link back to the thread
- Posts your plain reply in the thread with a link to the channel post
Replying to @erik's thread:
> Kinda cool to see rust sorta taking off in its own niche. It's a pretty cool language
its slowly taking over parts of the linux stack too isn't it?
The "Replying to @erik's thread" text is a clickable link that opens the thread.
its slowly taking over parts of the linux stack too isn't it?
> Also sent to ~town-square
The "Also sent to ~town-square" is a clickable link to the channel post.
From within any thread, type:
/ric your reply message here
- Must be used from within a thread (not the main channel)
- The message cannot be empty
- Supports full Mattermost markdown, emoji, etc. in your reply
- File attachments are forwarded on a best-effort basis (see Limitations below)
- Cross-platform: Works on web, desktop, and mobile (it's a server-side slash command)
- URL defanging: URLs in the quoted original message are wrapped in backticks to prevent duplicate link previews
- Blockquote stripping: Existing blockquotes in the original message are stripped to avoid nested quotes
- Long message truncation: Original messages over 200 characters are truncated in the quote
- Permalink support: Both the channel post and thread reply include clickable links to each other
- Live "view newer replies" link: When new replies are added to a thread that was shared via
/ric, the channel post automatically updates with a "view newer replies" link pointing to the latest reply - Bidirectional edit sync: Editing either the channel post or the thread post automatically syncs the change to the other — they behave as one post
- DM/GM support: Works in direct messages and group messages (picks the user's first team for permalink construction)
make distThe plugin bundle will be at dist/reply-in-channel-*.tar.gz.
Other useful targets:
make test— run Go testsmake server— compile server onlymake deploy— deploy to a Mattermost instance (requiresMM_SERVICESETTINGS_SITEURLandMM_ADMIN_TOKENenv vars)
- Build the plugin or download a release
- Go to System Console > Plugins > Plugin Management
- Upload the
.tar.gzfile - Enable the plugin
This is a server-only plugin (no webapp component). All functionality is implemented via:
- Slash command (
/ric) registered inOnActivate ExecuteCommandhook handles the command, creates posts viap.API.CreatePost(), and builds permalinksMessageHasBeenPostedhook listens for new thread replies and updates/ricchannel posts with a "view newer replies" linkMessageHasBeenUpdatedhook syncs edits bidirectionally between paired channel/thread posts- KV store maps thread root IDs to
/ricchannel post IDs, and stores bidirectional post pair mappings for edit sync formatQuotedReplyhandles message formatting (quoting, truncation, URL defanging, blockquote stripping)
Since the channel post needs a link to the thread reply (and vice versa), and neither post ID exists before creation:
- Create channel post without a permalink
- Create thread reply with a link to the channel post
- Update the channel post with a link to the thread reply
- File attachments: Mattermost's slash command API does not pass file attachment IDs to plugins. The plugin attempts to recover recently uploaded orphaned files, but this is best-effort and may not work in all cases. If attachments don't appear, try posting the file separately.
- Acting user is identified by the
Mattermost-User-IDheader (set by the Mattermost server) - The command only works in threads the user has access to
- Posts are created as the acting user (no BOT tag)
- Rate limiting is handled by Mattermost's built-in post creation limits