Handle STATUSMSG messages
authorMichael Marley <michael@michaelmarley.com>
Wed, 23 Mar 2016 20:47:02 +0000 (16:47 -0400)
committerMichael Marley <michael@michaelmarley.com>
Thu, 24 Mar 2016 00:35:22 +0000 (20:35 -0400)
commit4259bc3c5b11164245535e011a69efa6937bb6a6
tree915f2c79fe78a1ca573bfdc66c2b59820d6e5c32
parent9585227400dd89f8a4d6bbc723f2d36ca0dc1a70
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