New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colorize username sent to IRC using its crc32 IEEE checksum #423
Conversation
Hi, looking good! |
This is the message I was looking for! Thank you for the guidance!
…On Fri, 11 May 2018 at 21:26, Wim ***@***.***> wrote:
Hi, looking good!
Would you mind also adding a config option (and documentation in
matterbridge.toml.sample) ?
Like for example ColorNicks in
https://github.com/42wim/matterbridge/blob/master/bridge/config/config.go#L60
which is by default false.
You can then do a if b.GetBool("colornicks") { ... }
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#423 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgvKmqOxGJM9mXIy4_59wPhWMz8Fay_ks5txde3gaJpZM4T4uwU>
.
|
ea8a2da
to
a8cb668
Compare
Don't forget to let me know if the WIP is done :-) |
It might be close to be done now. Could you test it? |
I compiled the binary and tested it. Nicks on irc weren't colored and it seemed to reverse the telegram quote option, causing the bridge to drop the message but display the quote. I don't know much about go, though, so there's always the possibility that I didn't compile it correctly. There was a lot more text in the console on start up than there is on the main branch, for instance. |
bridge/irc/irc.go
Outdated
username := msg.Username | ||
if b.GetBool("Colornicks") { | ||
checksum := crc32.ChecksumIEEE([]byte(msg.Username)) | ||
username = string(0x03) + string(checksum%0x10) + msg.Username + string(0x03) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work, but changing to
username = fmt.Sprintf("\x03%d%s\x03", checksum%0x10, msg.Username)
works
If you fix this small thing and also update the matterbridge.toml.sample with your new feature, I can merge this. Thanks! |
a8cb668
to
199d66b
Compare
Where do I put the setting in |
As it is for IRC only please add on line 94 |
42a54e0
to
2402ffc
Compare
Please have a look now. |
Thanks! merged |
The commit message 1 starts with |
Yeah, my mistake, should've been looking more carefully. But doesn't matter that much. |
No description provided.