|
@@ -36,6 +36,7 @@ Client::Client(App *app, ActiveClient* ac, bool supportsSendPrivate):
|
|
mySpamMutedFlag(false),
|
|
mySpamMutedFlag(false),
|
|
myQWMutedFlag(false),
|
|
myQWMutedFlag(false),
|
|
myKeepNickTimer(new QTimer()),
|
|
myKeepNickTimer(new QTimer()),
|
|
|
|
+ mySPDetectionTimer(new QTimer()),
|
|
myFloodTimer(new QTimer()),
|
|
myFloodTimer(new QTimer()),
|
|
myQWBroadcastFloodTimer(new QTimer()),
|
|
myQWBroadcastFloodTimer(new QTimer()),
|
|
mySpamBroadcastFloodTimer(new QTimer()),
|
|
mySpamBroadcastFloodTimer(new QTimer()),
|
|
@@ -55,6 +56,7 @@ Client::~Client()
|
|
delete myFloodTimer;
|
|
delete myFloodTimer;
|
|
delete myQWBroadcastFloodTimer;
|
|
delete myQWBroadcastFloodTimer;
|
|
delete mySpamBroadcastFloodTimer;
|
|
delete mySpamBroadcastFloodTimer;
|
|
|
|
+ delete mySPDetectionTimer;
|
|
}
|
|
}
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
@@ -166,6 +168,23 @@ void Client::parsePrintedLine()
|
|
|
|
|
|
QString message(myPrintLine.right(myPrintLine.size() - lastMatchSize));
|
|
QString message(myPrintLine.right(myPrintLine.size() - lastMatchSize));
|
|
|
|
|
|
|
|
+ // Detects whether s-p command is supported
|
|
|
|
+ if(mySPDetectionActive)
|
|
|
|
+ {
|
|
|
|
+ if(mySPDetectionTimer->isActive() && nick == Settings::globalInstance()->botName() && message == "s-p")
|
|
|
|
+ {
|
|
|
|
+ mySupportsSendPrivate = false;
|
|
|
|
+ mySPDetectionTimer->stop();
|
|
|
|
+ mySPDetectionActive = false;
|
|
|
|
+ }
|
|
|
|
+ else if(!mySPDetectionTimer->isActive())
|
|
|
|
+ {
|
|
|
|
+ mySupportsSendPrivate = true;
|
|
|
|
+ mySPDetectionTimer->stop();
|
|
|
|
+ mySPDetectionActive = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
QRegExp regex("^:\\s+\\.(spam|qw|help|qw_mute|qw_unmute|spam_mute|spam_unmute|lm)\\s*(.+)$");
|
|
QRegExp regex("^:\\s+\\.(spam|qw|help|qw_mute|qw_unmute|spam_mute|spam_unmute|lm)\\s*(.+)$");
|
|
if(regex.indexIn(message) == -1)
|
|
if(regex.indexIn(message) == -1)
|
|
return;
|
|
return;
|
|
@@ -450,6 +469,7 @@ void Client::onStuffedCmd(const char *cmd)
|
|
myOnServerFlag = true;
|
|
myOnServerFlag = true;
|
|
|
|
|
|
setPing(Settings::globalInstance()->botPing());
|
|
setPing(Settings::globalInstance()->botPing());
|
|
|
|
+ spDetection();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -482,6 +502,15 @@ bool Client::supportsSendPrivate() const
|
|
return mySupportsSendPrivate;
|
|
return mySupportsSendPrivate;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
+void Client::spDetection()
|
|
|
|
+{
|
|
|
|
+ say("s-p");
|
|
|
|
+ mySPDetectionTimer->setSingleShot(true);
|
|
|
|
+ mySPDetectionTimer->start(2000);
|
|
|
|
+ mySPDetectionActive = true;
|
|
|
|
+}
|
|
|
|
+
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
QString Client::parseNameFun(const QString &string)
|
|
QString Client::parseNameFun(const QString &string)
|
|
{
|
|
{
|