Enhance IRC join/part message support #1872
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A help channel on my IRC network uses matterbridge to link to a help channel on a related Discord. We've noticed a problem where people on the Discord end will respond to help requests from users who've already left. Enabling join/part message support is an option, but it'd be excessively chatty if every join/part was shown.
This adds a new feature that will selectively show join/part/nick change/quit messages if either a user was active recently or the message is inherently important (i.e. kicks and kills.) New config options are ShowActiveUserEvents and ActivityTimeout, explained below in the sample config. It also addresses an issue in the original code where a quit message handler would send an invalid channel in the bridge message because IRC QUIT events aren't populated with a channel name. (Neither are nick changes, which are also supported now.)
This is literally the first thing I've ever written in Go. I attempted to make it consistent with both your code style and language idioms, but please let me know if there's anything that needs to be addressed.