|
@@ -20,7 +20,6 @@ Client::Client(App *app, ActiveClient* ac):
|
|
|
myJoinMessagePrinted(false),
|
|
|
myJoinMessageScheduled(false)
|
|
|
{
|
|
|
- myEndFloodTime = QTime::currentTime();
|
|
|
myQWBroadcastFloodTime = myEndFloodTime;
|
|
|
mySpamBroadcastFloodTime = myEndFloodTime;
|
|
|
myJoinMessageTimer->setSingleShot(true);
|
|
@@ -34,6 +33,8 @@ Client::~Client()
|
|
|
void Client::connect(const char *host, quint16 port)
|
|
|
{
|
|
|
myJoinMessageScheduled = true; //Hi message only scheduled at bot connection
|
|
|
+ myEndFloodTime = QTime::currentTime();
|
|
|
+
|
|
|
QWClient::connect(host, port);
|
|
|
}
|
|
|
|
|
@@ -160,7 +161,7 @@ void Client::parsePrintedLine()
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- myEndFloodTime = QTime::currentTime().addSecs(Settings::globalInstance()->floodProtTime());
|
|
|
+ myEndFloodTime = currentTime.addSecs(Settings::globalInstance()->floodProtTime());
|
|
|
myFloodMsgPrinted = false;
|
|
|
|
|
|
QString command = regex.capturedTexts().at(1);
|
|
@@ -321,6 +322,11 @@ void Client::run()
|
|
|
say("Hi, I am QWNET's bot, type .help to see my commands.");
|
|
|
myJoinMessagePrinted = true;
|
|
|
}
|
|
|
+
|
|
|
+ /* Avoid wrap around */
|
|
|
+ if(QTime::currentTime().secsTo(myEndFloodTime) < -16000)
|
|
|
+ myEndFloodTime = QTime::currentTime();
|
|
|
+
|
|
|
QWClient::run();
|
|
|
}
|
|
|
|