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

* Fixed cmd_slowjoin (#129)

svn: 2308
Bryan Drewery 21 лет назад
Родитель
Сommit
d7289d29e2
3 измененных файлов с 8 добавлено и 9 удалено
  1. 1 0
      doc/UPDATES
  2. 3 5
      src/mod/channels.mod/channels.c
  3. 4 4
      src/mod/channels.mod/cmdschan.c

+ 1 - 0
doc/UPDATES

@@ -53,6 +53,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Added flag '+r' which will make a bot resolve all hosts it sees to match against userlist. (You should only set this per-chan) (#127)
 * Removed cmd line param '-s'; Tracing bot on startup will always make the bot die right away.
 * Trace detection cannot be set to 'ignore', lowest setting is now: 'die'
+* Fixed cmd_slowjoin (#129)
 
 1.2.4
 * Fixed cmd_botset not displaying botnick.

+ 3 - 5
src/mod/channels.mod/channels.c

@@ -227,10 +227,8 @@ sdprintf("OPTIONS: %s", options);
 
   if (channel_add(result, chname, options) == ERROR) /* drummer */
     putlog(LOG_BOTS, "@", "Invalid channel or channel options from %s for %s: %s", botnick, chname, result);
-  else { 
-    if (conf.bot->hub)
-      write_userfile(-1);
-  }
+  if (conf.bot->hub)
+    write_userfile(-1);
   if (!match && !conf.bot->hub)
     free(options);
 }
@@ -356,7 +354,7 @@ check_slowjoinpart(struct chanset_t *chan)
       chan->status &= ~CHAN_INACTIVE;
       chan->channel.jointime = 0;
     if (!conf.bot->hub && shouldjoin(chan) && !channel_active(chan) && !channel_joining(chan)) {
-      dprintf(DP_MODE, "JOIN %s %s\n", chan->name, chan->key_prot);
+      dprintf(DP_MODE, "JOIN %s %s\n", chan->dname, chan->key_prot);
       chan->status |= CHAN_JOINING;
     }
   } else if (channel_closed(chan)) {

+ 4 - 4
src/mod/channels.mod/cmdschan.c

@@ -549,12 +549,12 @@ static void cmd_slowjoin(int idx, char *par)
     if (ubot) {
       /* Variation: 60 secs intvl should be 60 +/- 15 */
       if (bot_hublevel(ubot) < 999) {
-	simple_sprintf(tmp, "sj %s 0\n", chan->dname);
+	simple_sprintf(tmp, "sj %s 0", chan->dname);
       } else {
 	int v = (random() % (intvl / 2)) - (intvl / 4);
 
 	delay += intvl;
-	simple_sprintf(tmp, "sj %s %i\n", chan->dname, delay + v);
+	simple_sprintf(tmp, "sj %s %i", chan->dname, delay + v);
 	count++;
       }
       putbot(ubot->handle, tmp);
@@ -612,12 +612,12 @@ static void cmd_slowpart(int idx, char *par)
       /* Variation: 60 secs intvl should be 60 +/- 15 */
       if (ubot) {
         if (bot_hublevel(ubot) < 999) {
-  	  simple_sprintf(tmp, "sp %s 0\n", chname);
+  	  simple_sprintf(tmp, "sp %s 0", chname);
         } else {
   	  int v = (random() % (intvl / 2)) - (intvl / 4);
 
   	  delay += intvl;
-  	  simple_sprintf(tmp, "sp %s %i\n", chname, delay + v);
+  	  simple_sprintf(tmp, "sp %s %i", chname, delay + v);
   	  count++;
         }
         putbot(ubot->handle, tmp);