Add configuration option for specific chat type format #5337
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.
Information
This PR closes #5332.
Details
Proposed feature:
Keep old configuration format for backward compatibility.
Add the ability to transform each format ('group-name':'chat-format' or format: 'chat-format') to allow per-type format.
To specify a per-type format, transform:
into
'' can be replaced by 'local', 'shout', 'question', 'unknown' and 'default'
Note that considering the early state of this PR, 'local' can't be fired by the plugin due to the implementation.
Format are evaluated in the following order. The first non is used:
It does not affect the group and general format order which remains the same:
Environments tested:
OS: Linux 6.1.25-1-MANJARO
Java version: OpenJDK Runtime Environment (build 19.0.1+10-21)
Demonstration:
As it's a small PR, everything is described in the 'Proposed feature' section above.
Additional notes:
I apologize for this PR that aims to close an unreviewed issue.
I will be very busy with personnal stuff in the upcomming weeks and I needed to release this as soon as possible.
It leads to this PR which is clearly not finished as we didn't manage to talk about how to implement it.
Due to its size, it does not matter if it's done another way, the PR is only here to save you some work.
For code notes, you should be aware that I created three inner classes in the Settings class that should be moved.
And as specified in the 'Proposed feature' section, 'local' chat type can't be triggered.
I didn't update the config.yml documentation either.