Sync caps, use signal/slot, CAP NEW/DEL, polish
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 7 Jun 2016 15:05:55 +0000 (11:05 -0400)
committerShane Synan <digitalcircuit36939@gmail.com>
Mon, 13 Jun 2016 21:00:49 +0000 (17:00 -0400)
commitdccbef488a2299cf08146cdfc11933a8fe28a387
tree68eaae0d5b2103cf14fccc9dd1cf4312919022ea
parenta0bcb6393bc23734c9df0283a3ddbe4ec63c2f11
Sync caps, use signal/slot, CAP NEW/DEL, polish

Expose IRCv3 capabilities in the synced Network object.  In testing,
this works fine with older/newer cores/clients.

Migrate capability negotiation to Qt Slots/Signals (events), allowing
easier future scriptability and general reacting to IRCv3.

In the future, the client could detect if IrcCap::SASL is present and
in the settings UI recommend SASL over NickServ, it could warn if
IrcCap::SaslMech::EXTERNAL is not available, etc.

Handle CAP NEW and CAP DEL, to comply with cap-notify and IRCv3.2
requirements.  Might make ZNC users happier, too.

Show available, requested, and successful capabilities during
capability negotiation.

Move IRCv3 list of capabilities and SASL handling to new header,
irccap.h  This reduces clutter in network.h, and via new QString
constants typos are now compile-time errors.  Update CMakeLists.txt
for automoc and Qt Creator to know of the new file.

Preliminary test results on Ubuntu:
> New core, new client - works fine
> New core, old client - client prints warnings to console but works
(Complains of no matching slot for sync call.  Old client doesn't
need the new information, though, so it shouldn't cause issues.)
> New client, old core - works fine, simply assuming no IRCv3
(Quassel didn't support IRCv3 cap negotiation before now, so that's a
safe assumption to make)
> New core, Quasseldroid alpha - works fine, warnings in debug log
src/common/CMakeLists.txt
src/common/irccap.h [new file with mode: 0644]
src/common/network.cpp
src/common/network.h
src/core/corenetwork.cpp
src/core/corenetwork.h
src/core/coresessioneventprocessor.cpp
src/core/coresessioneventprocessor.h
src/core/ircparser.cpp