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

* Removed all the unused bindings

svn: 1032
Bryan Drewery 22 лет назад
Родитель
Сommit
7996dff984
8 измененных файлов с 5 добавлено и 108 удалено
  1. 2 6
      src/botcmd.c
  2. 0 18
      src/botnet.c
  3. 0 10
      src/cmds.c
  4. 3 60
      src/core_binds.c
  5. 0 5
      src/core_binds.h
  6. 0 6
      src/dcc.c
  7. 0 2
      src/dccutil.c
  8. 0 1
      src/mod/console.mod/console.c

+ 2 - 6
src/botcmd.c

@@ -118,10 +118,11 @@ static void bot_chan2(int idx, char *msg)
     /* Send to new version bots */
     /* Send to new version bots */
     if (i >= 0)
     if (i >= 0)
       botnet_send_chan(idx, from, NULL, chan, msg);
       botnet_send_chan(idx, from, NULL, chan, msg);
-    if (strchr(from, '@') != NULL)
+/*    if (strchr(from, '@') != NULL)
       check_bind_chat(from, chan, msg);
       check_bind_chat(from, chan, msg);
     else
     else
       check_bind_bcst(from, chan, msg);
       check_bind_bcst(from, chan, msg);
+*/
   }
   }
 }
 }
 
 
@@ -256,7 +257,6 @@ static void bot_actchan(int idx, char *par)
   }
   }
   chanout_but(-1, chan, "* %s %s\n", from, par);
   chanout_but(-1, chan, "* %s %s\n", from, par);
   botnet_send_act(idx, from, NULL, chan, par);
   botnet_send_act(idx, from, NULL, chan, par);
-  check_bind_act(from, chan, par);
 }
 }
 
 
 /* priv <from> <to> <message>
 /* priv <from> <to> <message>
@@ -1121,11 +1121,9 @@ static void bot_join(int idx, char *par)
   if (i != chan) {
   if (i != chan) {
     if (i >= 0) {
     if (i >= 0) {
       chanout_but(-1, i, "*** (%s) %s %s %s.\n", bot, nick, NET_LEFTTHE, i ? "channel" : "party line");
       chanout_but(-1, i, "*** (%s) %s %s %s.\n", bot, nick, NET_LEFTTHE, i ? "channel" : "party line");
-      check_bind_chpt(bot, nick, sock, i);
     }
     }
     if (!linking)
     if (!linking)
     chanout_but(-1, chan, "*** (%s) %s %s %s.\n", bot, nick, NET_JOINEDTHE, chan ? "channel" : "party line");
     chanout_but(-1, chan, "*** (%s) %s %s %s.\n", bot, nick, NET_JOINEDTHE, chan ? "channel" : "party line");
-    check_bind_chjn(bot, nick, chan, y[0], sock, par);
   }
   }
 }
 }
 
 
@@ -1154,8 +1152,6 @@ static void bot_part(int idx, char *par)
     touch_laston(u, TBUF, now);
     touch_laston(u, TBUF, now);
   }
   }
   if ((partyidx = getparty(bot, sock)) != -1) {
   if ((partyidx = getparty(bot, sock)) != -1) {
-    if (party[partyidx].chan >= 0)
-      check_bind_chpt(bot, nick, sock, party[partyidx].chan);
     if (!silent) {
     if (!silent) {
       register int chan = party[partyidx].chan;
       register int chan = party[partyidx].chan;
 
 

+ 0 - 18
src/botnet.c

@@ -348,8 +348,6 @@ void rempartybot(char *bot)
 
 
   for (i = 0; i < parties; i++)
   for (i = 0; i < parties; i++)
     if (!egg_strcasecmp(party[i].bot, bot)) {
     if (!egg_strcasecmp(party[i].bot, bot)) {
-      if (party[i].chan >= 0)
-        check_bind_chpt(bot, party[i].nick, party[i].sock, party[i].chan);
       remparty(bot, party[i].sock);
       remparty(bot, party[i].sock);
       i--;
       i--;
     }
     }
@@ -932,9 +930,6 @@ int botunlink(int idx, char *nick, char *reason)
     while (parties) {
     while (parties) {
       parties--;
       parties--;
       /* Assert? */
       /* Assert? */
-      if (party[i].chan >= 0)
-        check_bind_chpt(party[i].bot, party[i].nick, party[i].sock,
-		       party[i].chan);
     }
     }
   }
   }
   return 0;
   return 0;
@@ -1369,8 +1364,6 @@ static void cont_tandem_relay(int idx, char *buf, register int i)
 		dcc[uidx].nick, BOT_PARTYLEFT);
 		dcc[uidx].nick, BOT_PARTYLEFT);
     if (dcc[uidx].u.chat->channel < GLOBAL_CHANS)
     if (dcc[uidx].u.chat->channel < GLOBAL_CHANS)
       botnet_send_part_idx(uidx, NULL);
       botnet_send_part_idx(uidx, NULL);
-    check_bind_chpt(conf.bot->nick, dcc[uidx].nick, dcc[uidx].sock,
-		   dcc[uidx].u.chat->channel);
   }
   }
   check_bind_chof(dcc[uidx].nick, uidx);
   check_bind_chof(dcc[uidx].nick, uidx);
   dcc[uidx].type = &DCC_RELAYING;
   dcc[uidx].type = &DCC_RELAYING;
@@ -1408,8 +1401,6 @@ static void eof_dcc_relay(int idx)
       botnet_send_join_idx(j, -1);
       botnet_send_join_idx(j, -1);
   }
   }
   check_bind_chon(dcc[j].nick, j);
   check_bind_chon(dcc[j].nick, j);
-  check_bind_chjn(conf.bot->nick, dcc[j].nick, dcc[j].u.chat->channel,
-		 geticon(j), dcc[j].sock, dcc[j].host);
   killsock(dcc[idx].sock);
   killsock(dcc[idx].sock);
   lostdcc(idx);
   lostdcc(idx);
 }
 }
@@ -1503,9 +1494,6 @@ static void dcc_relaying(int idx, char *buf, int j)
   dcc[idx].u.chat = ci;
   dcc[idx].u.chat = ci;
   dcc[idx].type = &DCC_CHAT;
   dcc[idx].type = &DCC_CHAT;
   check_bind_chon(dcc[idx].nick, idx);
   check_bind_chon(dcc[idx].nick, idx);
-  if (dcc[idx].u.chat->channel >= 0)
-    check_bind_chjn(conf.bot->nick, dcc[idx].nick, dcc[idx].u.chat->channel,
-		   geticon(idx), dcc[idx].sock, dcc[idx].host);
   killsock(dcc[j].sock);
   killsock(dcc[j].sock);
   lostdcc(j);
   lostdcc(j);
 }
 }
@@ -1708,14 +1696,8 @@ void restart_chons()
   for (i = 0; i < dcc_total; i++) {
   for (i = 0; i < dcc_total; i++) {
     if (dcc[i].type == &DCC_CHAT) {
     if (dcc[i].type == &DCC_CHAT) {
       check_bind_chon(dcc[i].nick, i);
       check_bind_chon(dcc[i].nick, i);
-      check_bind_chjn(conf.bot->nick, dcc[i].nick, dcc[i].u.chat->channel,
-		     geticon(i), dcc[i].sock, dcc[i].host);
     }
     }
   }
   }
-  for (i = 0; i < parties; i++) {
-    check_bind_chjn(party[i].bot, party[i].nick, party[i].chan,
-		   party[i].flag, party[i].sock, party[i].from);
-  }
 }
 }
 
 
 static int get_role(char *bot)
 static int get_role(char *bot)

+ 0 - 10
src/cmds.c

@@ -548,7 +548,6 @@ static void cmd_me(struct userrec *u, int idx, char *par)
       dprintf(i, "* %s %s\n", dcc[idx].nick, par);
       dprintf(i, "* %s %s\n", dcc[idx].nick, par);
   botnet_send_act(idx, conf.bot->nick, dcc[idx].nick,
   botnet_send_act(idx, conf.bot->nick, dcc[idx].nick,
 		  dcc[idx].u.chat->channel, par);
 		  dcc[idx].u.chat->channel, par);
-  check_bind_act(dcc[idx].nick, dcc[idx].u.chat->channel, par);
 }
 }
 
 
 static void cmd_motd(struct userrec *u, int idx, char *par)
 static void cmd_motd(struct userrec *u, int idx, char *par)
@@ -2687,8 +2686,6 @@ static void cmd_chat(struct userrec *u, int idx, char *par)
       return;
       return;
     } else {
     } else {
       dprintf(idx, "Leaving chat mode...\n");
       dprintf(idx, "Leaving chat mode...\n");
-      check_bind_chpt(conf.bot->nick, dcc[idx].nick, dcc[idx].sock,
-		     dcc[idx].u.chat->channel);
       chanout_but(-1, dcc[idx].u.chat->channel,
       chanout_but(-1, dcc[idx].u.chat->channel,
 		  "*** %s left the party line.\n",
 		  "*** %s left the party line.\n",
 		  dcc[idx].nick);
 		  dcc[idx].nick);
@@ -2748,8 +2745,6 @@ static void cmd_chat(struct userrec *u, int idx, char *par)
       }
       }
     } else {
     } else {
       oldchan = dcc[idx].u.chat->channel;
       oldchan = dcc[idx].u.chat->channel;
-      if (oldchan >= 0)
-	check_bind_chpt(conf.bot->nick, dcc[idx].nick, dcc[idx].sock, oldchan);
       if (!oldchan) {
       if (!oldchan) {
 	chanout_but(-1, 0, "*** %s left the party line.\n", dcc[idx].nick);
 	chanout_but(-1, 0, "*** %s left the party line.\n", dcc[idx].nick);
       } else if (oldchan > 0) {
       } else if (oldchan > 0) {
@@ -2763,8 +2758,6 @@ static void cmd_chat(struct userrec *u, int idx, char *par)
 	dprintf(idx, "Joining channel '%s'...\n", arg);
 	dprintf(idx, "Joining channel '%s'...\n", arg);
 	chanout_but(-1, newchan, "*** %s joined the channel.\n", dcc[idx].nick);
 	chanout_but(-1, newchan, "*** %s joined the channel.\n", dcc[idx].nick);
       }
       }
-      check_bind_chjn(conf.bot->nick, dcc[idx].nick, newchan, geticon(idx),
-		     dcc[idx].sock, dcc[idx].host);
       if (newchan < GLOBAL_CHANS)
       if (newchan < GLOBAL_CHANS)
 	botnet_send_join_idx(idx, oldchan);
 	botnet_send_join_idx(idx, oldchan);
       else if (oldchan < GLOBAL_CHANS)
       else if (oldchan < GLOBAL_CHANS)
@@ -4202,9 +4195,6 @@ static void cmd_whoami(struct userrec *u, int idx, char *par)
 
 
 static void cmd_quit(struct userrec *u, int idx, char *text)
 static void cmd_quit(struct userrec *u, int idx, char *text)
 {
 {
-	if (dcc[idx].u.chat->channel >= 0 && dcc[idx].u.chat->channel < GLOBAL_CHANS) {
-		check_bind_chpt(conf.bot->nick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
-	}
 	check_bind_chof(dcc[idx].nick, idx);
 	check_bind_chof(dcc[idx].nick, idx);
 	dprintf(idx, "*** Ja Mata\n");
 	dprintf(idx, "*** Ja Mata\n");
 	flush_lines(idx, dcc[idx].u.chat);
 	flush_lines(idx, dcc[idx].u.chat);

+ 3 - 60
src/core_binds.c

@@ -20,21 +20,15 @@
 extern cmd_t 		C_dcc[];
 extern cmd_t 		C_dcc[];
 
 
 static bind_table_t *BT_away = NULL, *BT_dcc = NULL;
 static bind_table_t *BT_away = NULL, *BT_dcc = NULL;
-static bind_table_t *BT_chat = NULL, *BT_act = NULL, *BT_bcst = NULL, *BT_note = NULL;
-static bind_table_t *BT_bot = NULL, *BT_nkch = NULL, *BT_chon = NULL, *BT_chof = NULL;
-static bind_table_t *BT_chpt = NULL, *BT_chjn = NULL, *BT_time = NULL;
+static bind_table_t *BT_note = NULL;
+static bind_table_t *BT_bot = NULL, *BT_nkch = NULL, *BT_chon = NULL;
+static bind_table_t *BT_time = NULL;
 
 
 void core_binds_init()
 void core_binds_init()
 {
 {
-        BT_act = bind_table_add("act", 3, "sis", MATCH_MASK, BIND_STACKABLE);
         BT_away = bind_table_add("away", 3, "sis", MATCH_MASK, BIND_STACKABLE);
         BT_away = bind_table_add("away", 3, "sis", MATCH_MASK, BIND_STACKABLE);
-        BT_bcst = bind_table_add("bcst", 3, "sis", MATCH_MASK, BIND_STACKABLE);
         BT_bot = bind_table_add("bot", 3, "sss", MATCH_EXACT, 0);
         BT_bot = bind_table_add("bot", 3, "sss", MATCH_EXACT, 0);
-        BT_chat = bind_table_add("chat", 3, "sis", MATCH_MASK, BIND_STACKABLE | BIND_BREAKABLE);
-        BT_chjn = bind_table_add("chjn", 6, "ssisis", MATCH_MASK, BIND_STACKABLE);
         BT_chon = bind_table_add("chon", 2, "si", MATCH_MASK | MATCH_FLAGS, BIND_STACKABLE);
         BT_chon = bind_table_add("chon", 2, "si", MATCH_MASK | MATCH_FLAGS, BIND_STACKABLE);
-        BT_chof = bind_table_add("chof", 2, "si", MATCH_MASK | MATCH_FLAGS, BIND_STACKABLE);
-        BT_chpt = bind_table_add("chpt", 4, "ssii", MATCH_MASK, BIND_STACKABLE);
         BT_dcc = bind_table_add("dcc", 3, "Uis", MATCH_PARTIAL | MATCH_FLAGS, 0);
         BT_dcc = bind_table_add("dcc", 3, "Uis", MATCH_PARTIAL | MATCH_FLAGS, 0);
         add_builtins("dcc", C_dcc);
         add_builtins("dcc", C_dcc);
         BT_nkch = bind_table_add("nkch", 2, "ss", MATCH_MASK, BIND_STACKABLE);
         BT_nkch = bind_table_add("nkch", 2, "ss", MATCH_MASK, BIND_STACKABLE);
@@ -125,28 +119,10 @@ void check_bind_chon(char *hand, int idx)
 
 
 void check_bind_chof(char *hand, int idx)
 void check_bind_chof(char *hand, int idx)
 {
 {
-  struct flag_record     fr = {FR_GLOBAL | FR_CHAN, 0, 0};
   struct userrec        *u = NULL;
   struct userrec        *u = NULL;
 
 
   u = get_user_by_handle(userlist, hand);
   u = get_user_by_handle(userlist, hand);
   touch_laston(u, "partyline", now);
   touch_laston(u, "partyline", now);
-  get_user_flagrec(u, &fr, NULL);
-  check_bind(BT_chof, hand, &fr, hand, idx);
-}
-
-int check_bind_chat(char *handle, int chan, const char *text)
-{
-  return check_bind(BT_chat, text, NULL, handle, chan, text);
-}
-
-void check_bind_act(const char *from, int chan, const char *text)
-{
-  check_bind(BT_act, text, NULL, from, chan, text);
-}
-
-void check_bind_bcst(const char *from, int chan, const char *text)
-{
-  check_bind(BT_bcst, text, NULL, from, chan, text);
 }
 }
 
 
 void check_bind_nkch(const char *ohand, const char *nhand)
 void check_bind_nkch(const char *ohand, const char *nhand)
@@ -159,39 +135,6 @@ int check_bind_note(const char *from, const char *to, const char *text)
   return check_bind(BT_note, to, NULL, from, to, text);
   return check_bind(BT_note, to, NULL, from, to, text);
 }
 }
 
 
-void check_bind_chjn(const char *bot, const char *nick, int chan, const char type, int sock, const char *host)
-{
-  struct flag_record    fr = {FR_GLOBAL, 0, 0};
-  char                  s[11] = "", t[2] = "";
-
-  t[0] = type;
-  t[1] = 0;
-  switch (type) {
-  case '^':
-    fr.global = USER_ADMIN;
-    break;
-  case '*':
-    fr.global = USER_OWNER;
-    break;
-  case '+':
-    fr.global = USER_MASTER;
-    break;
-  case '@':
-    fr.global = USER_OP;
-    break;
-  }
-  egg_snprintf(s, sizeof s, "%d", chan);
-  check_bind(BT_chjn, s, &fr, bot, nick, chan, t, sock, host);
-}
-
-void check_bind_chpt(const char *bot, const char *hand, int sock, int chan)
-{
-  char  v[11] = "";
-
-  egg_snprintf(v, sizeof v, "%d", chan);
-  check_bind(BT_chpt, v, NULL, bot, hand, sock, chan);
-}
-
 void check_bind_away(const char *bot, int idx, const char *msg)
 void check_bind_away(const char *bot, int idx, const char *msg)
 {
 {
   check_bind(BT_away, bot, NULL, bot, idx, msg);
   check_bind(BT_away, bot, NULL, bot, idx, msg);

+ 0 - 5
src/core_binds.h

@@ -4,15 +4,10 @@
 void core_binds_init();
 void core_binds_init();
 void check_bind_time(struct tm *tm);
 void check_bind_time(struct tm *tm);
 void check_bind_dcc(const char *, int, const char *);
 void check_bind_dcc(const char *, int, const char *);
-void check_bind_chjn(const char *, const char *, int, char, int, const char *);
-void check_bind_chpt(const char *, const char *, int, int);
 void check_bind_bot(const char *, const char *, const char *);
 void check_bind_bot(const char *, const char *, const char *);
 int check_bind_note(const char *, const char *, const char *);
 int check_bind_note(const char *, const char *, const char *);
 void check_bind_nkch(const char *, const char *);
 void check_bind_nkch(const char *, const char *);
 void check_bind_away(const char *, int, const char *);
 void check_bind_away(const char *, int, const char *);
-int check_bind_chat(char *, int, const char *);
-void check_bind_act(const char *, int, const char *);
-void check_bind_bcst(const char *, int, const char *);
 void check_bind_chon(char *, int);
 void check_bind_chon(char *, int);
 void check_bind_chof(char *, int);
 void check_bind_chof(char *, int);
 #endif /* !_CORE_BINDS_H */
 #endif /* !_CORE_BINDS_H */

+ 0 - 6
src/dcc.c

@@ -1052,7 +1052,6 @@ static void eof_dcc_chat(int idx)
 		dcc[idx].nick);
 		dcc[idx].nick);
     if (dcc[idx].u.chat->channel < GLOBAL_CHANS)
     if (dcc[idx].u.chat->channel < GLOBAL_CHANS)
       botnet_send_part_idx(idx, "lost dcc link");
       botnet_send_part_idx(idx, "lost dcc link");
-    check_bind_chpt(conf.bot->nick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
   }
   }
   check_bind_chof(dcc[idx].nick, idx);
   check_bind_chof(dcc[idx].nick, idx);
   killsock(dcc[idx].sock);
   killsock(dcc[idx].sock);
@@ -1155,11 +1154,6 @@ static void dcc_chat(int idx, char *buf, int i)
 	}
 	}
       }
       }
     } else {
     } else {
-	int r;
-
-	r = check_bind_chat(dcc[idx].nick, dcc[idx].u.chat->channel, buf);
-	if (r & BIND_RET_BREAK) return;
-
       if (dcc[idx].u.chat->away != NULL)
       if (dcc[idx].u.chat->away != NULL)
         not_away(idx);
         not_away(idx);
        if (dcc[idx].status & STAT_ECHO)
        if (dcc[idx].status & STAT_ECHO)

+ 0 - 2
src/dccutil.c

@@ -280,8 +280,6 @@ void dcc_chatter(int idx)
 	  botnet_send_join_idx(idx, -1);
 	  botnet_send_join_idx(idx, -1);
 	}
 	}
       }
       }
-      check_bind_chjn(conf.bot->nick, dcc[idx].nick, dcc[idx].u.chat->channel,
-		     geticon(idx), dcc[idx].sock, dcc[idx].host);
     }
     }
     /* But *do* bother with sending it locally */
     /* But *do* bother with sending it locally */
 
 

+ 0 - 1
src/mod/console.mod/console.c

@@ -286,7 +286,6 @@ static int console_chon(char *handle, int idx)
     if ((dcc[idx].u.chat->channel >= 0) &&
     if ((dcc[idx].u.chat->channel >= 0) &&
 	(dcc[idx].u.chat->channel < GLOBAL_CHANS)) {
 	(dcc[idx].u.chat->channel < GLOBAL_CHANS)) {
       botnet_send_join_idx(idx, -1);
       botnet_send_join_idx(idx, -1);
-      check_bind_chjn(conf.bot->nick, dcc[idx].nick, dcc[idx].u.chat->channel, geticon(idx), dcc[idx].sock, dcc[idx].host);
     }
     }
     if (info_party) {
     if (info_party) {
       char *p = get_user(&USERENTRY_INFO, dcc[idx].user);
       char *p = get_user(&USERENTRY_INFO, dcc[idx].user);