meebey / smuxi

Smuxi is an user-friendly and free IRC client for Linux, Windows and Mac OS X based on GNOME / GTK+
https://smuxi.im/
GNU General Public License v2.0
172 stars 46 forks source link

Engine-Campfire: split messages on CR instead of trying to parse #238

Closed carlosmn closed 9 years ago

carlosmn commented 9 years ago

We currently count the number of braces in order to determine when an object definition is done. However, this has all sorts of problems around quoting and strings.

It turns out that the server will send a CR as part of the newline it sends between each message, which it won't produce inside the objects, so we can split the message there and be confident that we're passing a full object to the deserializer.


This gets rid of a few issues around pasting code and just makes the whole loop much nicer.

meebey commented 9 years ago

is this issue important enough to go into stable?

carlosmn commented 9 years ago

I think so, yeah. If you go with the current code to smuxi's test campfire instance and paste something with closing braces there (like you'll find in there), smuxi will cut off the message and some of the message data will be nonsense.

meebey commented 9 years ago

please rebase on stable then

carlosmn commented 9 years ago

Done. I can't retarget the pull request, but you can merge this into stable.

meebey commented 9 years ago

Merged