This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH senpai] ui: casemap nicks for coloring

Message ID
DKIM signature
Download raw message
Patch: +4 -0
Prior to this, sending messages to a user with different letter case
(though this is the same user) was appearing in different colors.

Fixes #61
 ui/style.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ui/style.go b/ui/style.go
index d86e9f4..f1166f3 100644
--- a/ui/style.go
+++ b/ui/style.go
@@ -3,6 +3,8 @@ package ui
import (


@@ -232,6 +234,8 @@ var identColorBlacklist = []int{

func IdentColor(s string) (code int) {
	s = irc.CasemapRFC1459(s)

	h := fnv.New32()
	_, _ = h.Write([]byte(s))

Message ID
<20210525150645.4977-1-yyp@disroot.org> (view parent)
DKIM signature
Download raw message
While this will work in most cases, this doesn't use the casemapping
provided by the server and I'd like to move IRC-specific code out of
the ui module.

I'm currently working on a simpler version of android's AnnotatedString
that will contain what's necessary to keep track of colors and text
styles in a string.


Once that's done, ui.Line will need to be changed so that the head
color will be of type tcell.Color.

After that, the app module will be able to put ANSI codes in the
timeline and casemap nicks before setting the head color.
Reply to thread Export thread (mbox)