common: Sort user prefix channelmodes on add/set
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 29 May 2018 02:17:10 +0000 (21:17 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 6 Jun 2018 17:52:47 +0000 (19:52 +0200)
commit1a3cdccd4c4465bdb684a4e0927c8431e306c7cc
treebcbe5c58c1ec776ad0cdf1c4eb0839a61bd5281c
parent67e4eb295238453c94da41185bcdb20d908859d6
common: Sort user prefix channelmodes on add/set

Sort prefix channelmodes whenever adding/removing/setting per-channel
IrcUser modes.  This keeps the highest mode at the front, necessary
for backlog storage to allow only showing the highest mode.

It's not possible to get away without sorting as modes can be added
in any order.

modesToPrefixes/prefixesToModes operate in order, so sorting prefixes
results in sorted modes for free.  IrcUser modes don't need sorted as
they're not hierarchical and not stored anywhere.
src/common/ircchannel.cpp
src/common/network.cpp
src/common/network.h