Split messages on newlines as per IRC protocol
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 27 Dec 2016 13:26:03 +0000 (08:26 -0500)
committerDaniel Albers <daniel@lbe.rs>
Mon, 2 Jan 2017 14:11:24 +0000 (15:11 +0100)
commit97a9b1646bb0d6362cef14bac3a577481cc01e49
tree843feaf4e8363fc93777a35771b640cae3e94c51
parent2bcdfeb7291667014106f6add98f8e7866bb1cc7
Split messages on newlines as per IRC protocol

When handling user input sent over the protocol, split apart messages
on QChar::LineFeed, processing and displaying each as individual
messages sent one after the other.  This applies to /query, /say,
/notice, and /me.  Otherwise, the IRC protocol interprets anything
after each line break as a new message.

Fixes inability to send multi-line content via copy-paste on
Quasseldroid.  Quassel desktop currently works around this issue by
sending multiple individual messages for every line break.

Test case:
1.  Install Quasseldroid (stable or alpha), connect to a core
2.  Copy some text to the Android clipboard that has a line break in
    it (not just word-wrap).
3.  Paste into Quasseldroid
4.  Send message

Before: Message shows up with line break (LF character on desktop),
        IRC server treats all lines after first as raw commands.

After:  Message gets split into multiple smaller messages at each
        line break.

This should also work for /query, /say, /notice, and /me.

See: https://tools.ietf.org/html/rfc1459#page-8

Closes GH-263.
src/core/coreuserinputhandler.cpp