Handle STATUSMSG messages
authorMichael Marley <michael@michaelmarley.com>
Wed, 23 Mar 2016 20:47:02 +0000 (16:47 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 24 Apr 2016 20:35:03 +0000 (22:35 +0200)
commit6ca69e6cd11711b36f30c952ba3df6fff29a38f1
treeeaa3a5ad38863c277c2c750014bd974adc70b37e
parent76ecd41e6b901e163cfcd5fe2e140d0bbb68af91
Handle STATUSMSG messages

Previously PRIVMSGs to channels prefixed with certain characters
(usually "+" or "@") (example "@#quassel") would appear in new
query buffers instead of in the channel buffer.  People were using
that problem to broadcast query SPAM in active channels such as

This patch fixes the issue by detecting the condition, first in
ircparser.cpp where it will use the channel name instead of the
sender's nick as the target.  ctcpparser.cpp then sees the prefixed
channel name and reacts by truncating the prefix(es) and setting a
new flag so that the client can tell the message was a STATUSMSG.
A look-ahead system is used to ensure that the channel prefix
character is not stripped even when the channel prefix characters
and STATUSMSG prefix characters overlap.

The server-provided STATUSMSG prefixes are used if available,
otherwise "@" and "+" are used.

This patch doesn't make the client display the STATUSMSGs any
differently than regular messages.  I omitted this because there
was some discussion on the channel about the best way to display
these messages, but no conclusion was ever reached.  This patch
will at least stop the query SPAM and also provides the
infrastructure necessary to change the display format later.
src/common/message.h
src/common/network.cpp
src/common/network.h
src/core/ctcpparser.cpp
src/core/ircparser.cpp