feat(mattermost): add thread_replies config and typing indicator

Add two Mattermost channel enhancements:

1. thread_replies config option (default: false)
   - When false, replies go to the channel root instead of threading.
   - When true, replies thread on the original post.
   - Existing thread replies always stay in-thread regardless of setting.

2. Typing indicator (start_typing/stop_typing)
   - Implements the Channel trait's typing methods for Mattermost.
   - Fires POST /api/v4/users/me/typing every 4s in a background task.
   - Supports parent_id for threaded typing indicators.
   - Aborts cleanly on stop_typing via JoinHandle.

Updated all MattermostChannel::new call sites (start_channels, scheduler)
and added 9 unit tests covering thread routing and edge cases.
This commit is contained in:
Vernon Stinebaker 2026-02-18 16:51:15 +08:00 committed by Chummy
parent 41c3e62dad
commit 58120b1c69
4 changed files with 143 additions and 13 deletions

View file

@ -300,6 +300,7 @@ async fn deliver_if_configured(config: &Config, job: &CronJob, output: &str) ->
mm.bot_token.clone(),
mm.channel_id.clone(),
mm.allowed_users.clone(),
mm.thread_replies.unwrap_or(false),
);
channel.send(&SendMessage::new(output, target)).await?;
}