Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow nicks to be colored based on their hash #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jensecj
Copy link

@jensecj jensecj commented Jul 1, 2021

Adds a new variable circe-color-nicks-persist which causes nicknames to be colored by using their hash as an index into circe-nick-color-pool.

There are a couple of minor foibles:

Changing the signature of circe-nick-color-pick breaks backwards-compatability, I have looked around and not found anyone who actually used this anywhere, so I don't think it's a major problem, could be solved by making the new argument optional.

Changing circe-color-nicks-persist after some nicks have been popped from the pool reduces the available colors, but I don't imagine people flip-flopping the setting often.

@wasamasa
Copy link
Collaborator

I'd use a separate pool for fixed colors. That way it won't be depleted.

The hashing approach seems a tad clownshoes. Is it adapted from an existing solution? If not, I'd reuse something from Weechat: https://github.com/weechat/weechat/blob/master/src/gui/gui-nick.c

Might also make the code clearer to have a customizable hash function.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants