Make DCC support opt-in for now
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 1 Jan 2014 22:11:03 +0000 (23:11 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 1 Jan 2014 22:15:15 +0000 (23:15 +0100)
As support for DCC is unfinished, untested and potentially dangerous
(i.e. one could spam your desktop with millions of dialog boxes), disable
it by default.

People really wanting to play around with this may start the core
with --enable-experimental-dcc, but you have been warned.

src/common/main.cpp
src/core/coresessioneventprocessor.cpp

index ced7d5b..8ed40da 100644 (file)
@@ -118,6 +118,7 @@ int main(int argc, char **argv)
 #ifdef HAVE_SSL
     cliParser->addSwitch("require-ssl", 0, "Require SSL for client connections");
 #endif
 #ifdef HAVE_SSL
     cliParser->addSwitch("require-ssl", 0, "Require SSL for client connections");
 #endif
+    cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
 #endif
 
 #ifdef HAVE_KDE
 #endif
 
 #ifdef HAVE_KDE
index deca988..f8c5e34 100644 (file)
@@ -28,6 +28,7 @@
 #include "ctcpevent.h"
 #include "ircevent.h"
 #include "ircuser.h"
 #include "ctcpevent.h"
 #include "ircevent.h"
 #include "ircuser.h"
+#include "logger.h"
 #include "messageevent.h"
 #include "netsplit.h"
 #include "quassel.h"
 #include "messageevent.h"
 #include "netsplit.h"
 #include "quassel.h"
@@ -1020,6 +1021,12 @@ void CoreSessionEventProcessor::handleCtcpClientinfo(CtcpEvent *e)
 // http://en.wikipedia.org/wiki/Direct_Client-to-Client
 void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e)
 {
 // http://en.wikipedia.org/wiki/Direct_Client-to-Client
 void CoreSessionEventProcessor::handleCtcpDcc(CtcpEvent *e)
 {
+    // DCC support is unfinished, experimental and potentially dangerous, so make it opt-in
+    if (!Quassel::isOptionSet("enable-experimental-dcc")) {
+        quInfo() << "DCC disabled, start core with --enable-experimental-dcc if you really want to try it out";
+        return;
+    }
+
     // normal:  SEND <filename> <ip> <port> [<filesize>]
     // reverse: SEND <filename> <ip> 0 <filesize> <token>
     QStringList params = e->param().split(' ');
     // normal:  SEND <filename> <ip> <port> [<filesize>]
     // reverse: SEND <filename> <ip> 0 <filesize> <token>
     QStringList params = e->param().split(' ');