zerowidth / camper_van

A Campfire to IRC bridge
MIT License
129 stars 25 forks source link

Convert any nickname on the message. #57

Closed lunks closed 10 years ago

lunks commented 10 years ago

I often use nicknames on the message and ping several people. This makes sure I don't expose IRC nicknames and show proper Campfire usernames.

zerowidth commented 10 years ago

I like the idea, but there's two things I'd think about:

  1. Change the regex to match on word boundaries, that way "nathan" wouldn't also match "jonathan" by accident
  2. make it configurable, as I think this could lead to surprising output in some cases, and being on the translated side of things, you may not even notice.
lunks commented 10 years ago
  1. :+1:
  2. What kind of surprises? I've been hit by not having this implemented, i.e. I mentioned someone and thought it was being translated. We could have something to toggle nick translation, but IMHO this specific PR is for addressing expectations I have when mentioning someone in the middle of a message.
zerowidth commented 10 years ago

Re: surprises, I'm just sensitive to the fact that because camper van is a translation layer, you never really see what other people see. So if nicks were to be incorrectly converted (e.g. mid-word, which you've fixed) you'd never notice it. That's why I limited the replacement to ^nick: so it'd be predictable.

I suppose as long as no one's got a nickname that matches a common term that you're discussing in chat, it'd be just fine!

lunks commented 10 years ago

If it matches a common term, there's not much to be done. The user would probably be highlighted anyway. I, at least, can't think of a common term that could be messed when translating, i.e. if it's a single word the only difference would be the first letter being capitalized and as such not really an issue.

I see your concern, but I can't figure out any example. Perhaps you know one and are not telling me? :trollface:

zerowidth commented 10 years ago

Nah, I didn't have any specific examples, just paranoia. This looks fine, go for it.

lunks commented 10 years ago

Alright, thanks for the input!