colour names using WeeChat's own nick colours - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WeeChat already assigns a colour per nick from the user's weechat.color.chat_nick_colors palette via weechat.look.nick_color_hash, and exposes it as info_get("nick_color") and info_get("nick_color_name"). Use those rather than growing a palette and a hash here: a user who has tuned their IRC nick colours gets the same treatment in RRC, and any future change to either setting follows for free.
The key is the identity hash, not the advisory nickname. Colour then follows the person through a /nick, and somebody taking another's nickname does not take their colour with it -- the opposite of what keying on the name would give. Colours still repeat, so a shared colour proves nothing and the short hash stays the authoritative tell.
Names are coloured in the nicklist, on message and action lines, on join and part lines, and in private buffers. The body is never coloured: a reset closes the name, because the body is hub-supplied text that must carry no formatting the plugin did not choose.