Send extra modes via non-breaking protocol change 180/head
authorShane Synan <digitalcircuit36939@gmail.com>
Fri, 19 Feb 2016 09:17:26 +0000 (03:17 -0600)
committerShane Synan <digitalcircuit36939@gmail.com>
Fri, 19 Feb 2016 09:25:45 +0000 (03:25 -0600)
commit4aea5769f4c155234394957aa55360f111c12cbb
tree12c8777b9774db65944df892c825c7cdaf10c03d
parentba1c9e7925671c1393e0ff6b140f68a3dc1fe3cf
Send extra modes via non-breaking protocol change

Send extra user mode updates in backwards-compatible manner.

When multiple modes are received in IrcChannel::joinIrcUsers, call
addUserMode one time for each, then call ircuser->addUserModes() with
the new modes.  Perhaps less efficient, but avoids breaking protocol.

Reduce excess network traffic by only syncing IrcUser::setUserModes
and IrcUser::addUserModes when changes are made.

Preliminary test results on Ubuntu (more testing always welcome!)
* New core, new client - works fine (as one might hope)
* New core, old client - client prints warning to console but works
(IrcChannel modes might internally get out of sync, but visible
 channel list updates with mode changes, multiple modes, etc)
* New core, Quasseldroid alpha/NG - works fine
* Old core, new client - works fine

If desired, the warning and other potential risks could be avoided
entirely by implementing a new Feature flag and only sending the
additional mode information to clients that request it.  However,
this seemed excessive to avoid what in limited testing was only a
warning in the client console log, normally hidden away from sight.
src/common/ircchannel.cpp
src/common/ircuser.cpp
src/core/coresessioneventprocessor.cpp