Browse Source

Removed HI! message.

Mihawk 12 years ago
parent
commit
fee75d31a1
2 changed files with 6 additions and 25 deletions
  1. 6 20
      Client.cpp
  2. 0 5
      Client.h

+ 6 - 20
Client.cpp

@@ -35,17 +35,13 @@ Client::Client(App *app, ActiveClient* ac, bool supportsSendPrivate):
   myOnServerFlag(false),
   mySpamMutedFlag(false),
   myQWMutedFlag(false),
-  myJoinMessageTimer(new QTimer()),
   myKeepNickTimer(new QTimer()),
   myFloodTimer(new QTimer()),
   myQWBroadcastFloodTimer(new QTimer()),
   mySpamBroadcastFloodTimer(new QTimer()),
-  myJoinMessagePrinted(false),
-  myJoinMessageScheduled(false),
   mySupportsSendPrivate(supportsSendPrivate),
   myMaxClients(0)
 {
-  myJoinMessageTimer->setSingleShot(true);
   myKeepNickTimer->setSingleShot(true);
   myFloodTimer->setSingleShot(true);
   myQWBroadcastFloodTimer->setSingleShot(true);
@@ -55,7 +51,6 @@ Client::Client(App *app, ActiveClient* ac, bool supportsSendPrivate):
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Client::~Client()
 {
-  delete myJoinMessageTimer;
   delete myKeepNickTimer;
   delete myFloodTimer;
   delete myQWBroadcastFloodTimer;
@@ -65,7 +60,6 @@ Client::~Client()
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 void Client::connect(const char *host, quint16 port)
 {
-  myJoinMessageScheduled = true; //Hi message only scheduled at bot connection
   setPing(13);
   QWClient::connect(host, port);
 }
@@ -425,13 +419,13 @@ void Client::onDownloadStarted(const char *fileName)
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 void Client::run()
 {
-  if(!myJoinMessageTimer->isActive() && !myJoinMessagePrinted)
-  {
-    say("Hi, I am QWNET's bot, type .help to see my commands.");
-    myJoinMessagePrinted = true;
-  }
+  //  if(!myJoinMessageTimer->isActive() && !myJoinMessagePrinted)
+  //  {
+  //    say("Hi, I am QWNET's bot, type .help to see my commands.");
+  //    myJoinMessagePrinted = true;
+  //  }
 
-  /* Keep nick... Simply set name again after 10 secs */
+  /* Keep nick... Simply set name again after 30 secs */
   if(!myKeepNickTimer->isActive())
   {
     setName(Settings::globalInstance()->botName().toAscii().data());
@@ -456,14 +450,6 @@ void Client::onStuffedCmd(const char *cmd)
     myOnServerFlag = true;
 
     setPing(Settings::globalInstance()->botPing());
-
-    /* Only say hi if hi is scheduled */
-    if(myJoinMessageScheduled)
-    {
-      myJoinMessageTimer->start(Settings::globalInstance()->timeToSayHiAfterConnected()*1000);
-      myJoinMessagePrinted = false;
-      myJoinMessageScheduled = false;
-    }
   }
 }
 

+ 0 - 5
Client.h

@@ -230,7 +230,6 @@ private:
   bool              mySpamMutedFlag;
   bool              myQWMutedFlag;
 
-  QTimer*           myJoinMessageTimer; // After that time the bot will say hi.
   QTimer*           myKeepNickTimer;    // Interval in which the bot tries to retake his nickname
 
   // Flood timers
@@ -244,12 +243,8 @@ private:
   QTime             mySpamBroadcastFloodTimerStart;
 
   // Used to avoid information printed countless times
-  bool              myJoinMessagePrinted;
   bool							myFloodMsgPrinted;
 
-  // Inicates whether bot has to say Hi
-  bool              myJoinMessageScheduled;
-
   // Indicates whether this server supports s-p command
   // This is set manually the client doesn't auto detect it
   bool              mySupportsSendPrivate;