ekmartin / slack-irc

Connects Slack and IRC channels by sending messages back and forth.
MIT License
587 stars 155 forks source link

Allow customization of Slack/IRC username format #56

Closed ekmartin closed 8 years ago

ekmartin commented 9 years ago

Right now everything is posted to Slack with the username of the IRC message author. This sometimes causes confusion from people that doesn't know where the messages are coming from, especially in large channels.

An option could be adding a slackUsernameFormat config option with username interpolation, so for example $username (IRC) would result in messages being posted by ekmartin (IRC) instead of just ekmartin. Could also have an ircUsernameFormat which would default to <$username>, which would allow stuff like #19.

Another option would of course just be to change the default representation from just username to something suffixed with (sent from IRC) or similar. The less config options the better, however as this would be a breaking change with little flexibility I'm not sure.

Any feedback is welcome.

bpang commented 8 years ago

I think you can currently get the same functionality by just renaming your bot as something like "slack-ircbot". Having (IRC) or -irc appended would be fine as well, but perhaps a bit redundant. Maybe it could just be a config param.

laughinghan commented 8 years ago

+1 :star2:

I think this makes tons of sense as a config option. Maybe in v4 this could default to '$nick (IRC)' (that'd be my choice, at least), but I think even then you'd want it to be configurable, so why not add it now backwards-compatibly.

ekmartin commented 8 years ago

Sounds good. If someone wants to give it a shot and send a pull request I'd be glad to help, if not I'll take a look at it as soon as I get time.

laughinghan commented 8 years ago

Okay I did it in a purely additive way, but I want to point out that defaulting to $username (IRC) would not actually be a breaking change, because what would it break? All previously working Slack<->IRC bridge situations would continue to work after upgrading. Seems pretty cosmetic to me. So, if you feel like that's how you would've formatted it if you could do it over again because it's better, I think you should strongly consider just going ahead and doing it; I'm happy to make that change to the code and tests for you and update my PR if you want.