Split messages on newlines as per IRC protocol
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 27 Dec 2016 13:26:03 +0000 (08:26 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Apr 2018 21:14:03 +0000 (23:14 +0200)
commit28107860d0c324fa015477299853c4060bb5403e
tree49d5b48868b3df7b0b82239aad5f3c7da2042bee
parentb494cb88dd3c38b3d2f318a72ce6761847687289
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.

(cherry picked from commit 97a9b1646bb0d6362cef14bac3a577481cc01e49)
src/core/coreuserinputhandler.cpp