소스 검색

* Port [3673] to 1.2.15
* Bots now check their own hostmask before opping or requesting assistance to join a channel



svn: 3674

Bryan Drewery 18 년 전
부모
커밋
e723d6859b
2개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      doc/UPDATES
  2. 14 0
      src/mod/irc.mod/irc.c

+ 1 - 0
doc/UPDATES

@@ -8,6 +8,7 @@
 * Add more ctcp version responses (mirc scripts), and some others, such as irssi/xchat/snak/cgi::irc
 * Add more ctcp version responses (mirc scripts), and some others, such as irssi/xchat/snak/cgi::irc
 * Add more 'responses' (ie, kicks reasons)
 * Add more 'responses' (ie, kicks reasons)
 * Added new chanset flag '+knock' which will make +y bots auto invite USERS. (No flag restrictions currently)
 * Added new chanset flag '+knock' which will make +y bots auto invite USERS. (No flag restrictions currently)
+* Bots now check their own hostmask before opping or requesting assistance to join a channel
 
 
 1.2.14 - http://wraith.botpack.net/milestone/1.2.14
 1.2.14 - http://wraith.botpack.net/milestone/1.2.14
 * Fix another bug in shell functions. (fixes #321)
 * Fix another bug in shell functions. (fixes #321)

+ 14 - 0
src/mod/irc.mod/irc.c

@@ -723,6 +723,13 @@ request_op(struct chanset_t *chan)
     return;
     return;
   }
   }
 
 
+  /* Check if my hostmask is recognized (every 10th time) */
+  static int check_hostmask_cnt = 10;
+  if (check_hostmask_cnt++ == 10) {
+    check_hostmask();
+    check_hostmask_cnt = 0;
+  }
+
   struct flag_record fr = { FR_GLOBAL | FR_CHAN | FR_BOT, 0, 0, 0 };
   struct flag_record fr = { FR_GLOBAL | FR_CHAN | FR_BOT, 0, 0, 0 };
 
 
   get_user_flagrec(conf.bot->u, &fr, chan->dname, chan);
   get_user_flagrec(conf.bot->u, &fr, chan->dname, chan);
@@ -834,6 +841,13 @@ request_in(struct chanset_t *chan)
   if (!shouldjoin(chan))
   if (!shouldjoin(chan))
     return;
     return;
 
 
+  /* Check if my hostmask is recognized (every 10th time) */
+  static int check_hostmask_cnt = 10;
+  if (check_hostmask_cnt++ == 10) {
+    check_hostmask();
+    check_hostmask_cnt = 0;
+  }
+
   struct flag_record fr = { FR_GLOBAL | FR_CHAN | FR_BOT, 0, 0, 0 };
   struct flag_record fr = { FR_GLOBAL | FR_CHAN | FR_BOT, 0, 0, 0 };
 
 
   get_user_flagrec(conf.bot->u, &fr, NULL);
   get_user_flagrec(conf.bot->u, &fr, NULL);