Просмотр исходного кода

* Don't bother with server_send_ison() timer if not using ISON

Bryan Drewery 16 лет назад
Родитель
Сommit
e4f8d9b7ae
2 измененных файлов с 20 добавлено и 12 удалено
  1. 12 2
      src/mod/server.mod/server.c
  2. 8 10
      src/mod/server.mod/servmsg.c

+ 12 - 2
src/mod/server.mod/server.c

@@ -990,8 +990,18 @@ static void server_secondly()
   if (!resolvserv && serv < 0 && !trying_server)
     connect_server();
 
-  if (!conf.bot->hub) {
-    static int ison_cnt = 0;
+  if (server_online) {
+    if (keepnick && !use_monitor) {
+      static int ison_cnt = 0;
+
+      if (ison_time == 0) //If someone sets this to 0, all hell will break loose!
+        ison_time = 10;
+      if (ison_cnt >= ison_time) {
+        server_send_ison();
+        ison_cnt = 0;
+      } else
+        ++ison_cnt;
+    }
 
     if (ison_time == 0) //If someone sets this to 0, all hell will break loose!
       ison_time = 10;

+ 8 - 10
src/mod/server.mod/servmsg.c

@@ -790,16 +790,14 @@ static int gotwall(char *from, char *msg)
 
 void server_send_ison()
 {
-  if (server_online && keepnick && !use_monitor) {
-    // Only check if we're not on jupenick, or there is no jupenick and we're not on the preferred nick
-    bool have_jupenick = jupenick[0] ? match_my_nick(jupenick) : 0;
-    if (!have_jupenick) {
-      /* See if my nickname is in use and if if my nick is right.  */
-      if (jupenick[0] && !have_jupenick)
-        dprintf(DP_SERVER, "ISON %s %s\n", origbotname, jupenick);
-      else if (!match_my_nick(origbotname)) 
-        dprintf(DP_SERVER, "ISON %s\n", origbotname);
-    }
+  // Only check if we're not on jupenick, or there is no jupenick and we're not on the preferred nick
+  bool have_jupenick = jupenick[0] ? match_my_nick(jupenick) : 0;
+  if (!have_jupenick) {
+    /* See if my nickname is in use and if if my nick is right.  */
+    if (jupenick[0] && !have_jupenick)
+      dprintf(DP_SERVER, "ISON %s %s\n", origbotname, jupenick);
+    else if (!match_my_nick(origbotname))
+      dprintf(DP_SERVER, "ISON %s\n", origbotname);
   }
 }
 /* Called once a minute... but if we're the only one on the