ircanywhere / irc-factory

A rebuilt irc-factory from simple-irc-socket and irc-message. Get support at #ircanywhere on freenode
https://ircanywhere.com
MIT License
60 stars 14 forks source link

Multi-byte safe message truncate #12

Closed quiiver closed 10 years ago

quiiver commented 10 years ago

We were running into a bug where the truncate code would get stuck in an infinite loop if the last word was > the max length (like a really long url). This is a simpler truncation that is respective of multibyte strings and uses recursion instead of a while loop.

rickihastings commented 10 years ago

I've never encountered the problem so thanks for the fix, this also seems to be a much nicer way of doing things. Thank you!

quiiver commented 10 years ago

@rickihastings you probably don't have people sending 2048 char urls into channels :D

rickihastings commented 10 years ago

Yep definitely not :laughing: