[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 4 16:38:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-04 21:37:55 UTC
Commited by: stdarg

Modified files:
     src/cmds.c src/dcc.c src/tcldcc.c src/tclhash.c

Log message:

Fixed the quit command to make it an actual dcc command, not a special
thing in dcc.c.

---------------------- diff included ----------------------
Index: eggdrop1.7/src/cmds.c
diff -u eggdrop1.7/src/cmds.c:1.66 eggdrop1.7/src/cmds.c:1.67
--- eggdrop1.7/src/cmds.c:1.66	Mon Aug 27 20:33:11 2001
+++ eggdrop1.7/src/cmds.c	Thu Oct  4 16:37:44 2001
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  *
- * $Id: cmds.c,v 1.66 2001/08/28 01:33:11 ite Exp $
+ * $Id: cmds.c,v 1.67 2001/10/04 21:37:44 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -2718,6 +2718,45 @@
   putlog(LOG_CMDS, "*", "#%s# whoami", dcc[idx].nick);
 }
 
+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_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
+	}
+	check_tcl_chof(dcc[idx].nick, dcc[idx].sock);
+	dprintf(idx, "*** See you later cowboy!\n\n");
+	flush_lines(idx, dcc[idx].u.chat);
+	putlog(LOG_MISC, "*", _("DCC connection closed (%s!%s)"), dcc[idx].nick, dcc[idx].host);
+	if (dcc[idx].u.chat->channel >= 0) {
+		chanout_but(-1, dcc[idx].u.chat->channel, "*** %s left the party line%s%s\n", dcc[idx].nick, text[0] ? ": " : ".", buf);
+		if (dcc[idx].u.chat->channel < 100000) {
+			botnet_send_part_idx(idx, text);
+		}
+	}
+
+	if (dcc[idx].u.chat->su_nick) {
+		dcc[idx].user = get_user_by_handle(userlist, dcc[idx].u.chat->su_nick);
+		dcc[idx].type = &DCC_CHAT;
+		dprintf(idx, "Returning to real nick %s!\n", dcc[idx].u.chat->su_nick);
+		nfree(dcc[idx].u.chat->su_nick);
+		dcc[idx].u.chat->su_nick = NULL;
+		dcc_chatter(idx);
+		if (dcc[idx].u.chat->channel < 100000 && dcc[idx].u.chat->channel >= 0) {
+			botnet_send_join_idx(idx, -1);
+		}
+	}
+	else if ((dcc[idx].sock != STDOUT) || backgrd) {
+		killsock(dcc[idx].sock);
+		lostdcc(idx);
+	}
+	else {
+		dprintf(DP_STDOUT, "\n### SIMULATION RESET\n\n");
+		dcc_chatter(idx);
+	}
+}
+
+
+
 /* DCC CHAT COMMANDS
  */
 /* Function call should be:
@@ -2771,7 +2810,7 @@
   {"handle",		"",	(Function) cmd_handle,		NULL},
   {"nick",		"",	(Function) cmd_handle,		NULL},
   {"page",		"",	(Function) cmd_page,		NULL},
-  {"quit",		"",	(Function) NULL,		NULL},
+  {"quit",		"",	(Function) cmd_quit,		NULL},
   {"rehash",		"m",	(Function) cmd_rehash,		NULL},
   {"rehelp",		"n",	(Function) cmd_rehelp,		NULL},
   {"relay",		"t",	(Function) cmd_relay,		NULL},
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.53 eggdrop1.7/src/dcc.c:1.54
--- eggdrop1.7/src/dcc.c:1.53	Thu Sep 27 22:15:34 2001
+++ eggdrop1.7/src/dcc.c	Thu Oct  4 16:37:44 2001
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.53 2001/09/28 03:15:34 stdarg Exp $
+ * $Id: dcc.c,v 1.54 2001/10/04 21:37:44 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -907,54 +907,14 @@
       strcpy(d, "\033[0m");
     else
       *d = 0;
-    if (buf[0]) {		/* Nothing to say - maybe paging... */
-      if ((buf[0] == '.') || (dcc[idx].u.chat->channel < 0)) {
+
+    if ((buf[0] == '.') || (dcc[idx].u.chat->channel < 0)) {
 	if (buf[0] == '.')
 	  buf++;
 	v = newsplit(&buf);
 	rmspace(buf);
-	if (check_tcl_dcc(v, idx, buf)) {
-	  if (dcc[idx].u.chat->channel >= 0) {
-	    check_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
-			   dcc[idx].u.chat->channel);
-	  }
-	  check_tcl_chof(dcc[idx].nick, dcc[idx].sock);
-	  dprintf(idx, "*** Ja mata!\n");
-	  flush_lines(idx, dcc[idx].u.chat);
-	  putlog(LOG_MISC, "*", _("DCC connection closed (%s!%s)"), dcc[idx].nick,
-		 dcc[idx].host);
-	  if (dcc[idx].u.chat->channel >= 0) {
-	    chanout_but(-1, dcc[idx].u.chat->channel,
-			"*** %s left the party line%s%s\n",
-			dcc[idx].nick, buf[0] ? ": " : ".", buf);
-	    if (dcc[idx].u.chat->channel < 100000)
-	      botnet_send_part_idx(idx, buf);
-	  }
-	  if (dcc[idx].u.chat->su_nick) {
-	    dcc[idx].user = get_user_by_handle(userlist,
-					       dcc[idx].u.chat->su_nick);
-	    strcpy(dcc[idx].nick, dcc[idx].u.chat->su_nick);
-	    dcc[idx].type = &DCC_CHAT;
-	    dprintf(idx, "Returning to real nick %s!\n",
-		    dcc[idx].u.chat->su_nick);
-	    nfree(dcc[idx].u.chat->su_nick);
-	    dcc[idx].u.chat->su_nick = NULL;
-	    dcc_chatter(idx);
-	    if (dcc[idx].u.chat->channel < 100000 &&
-		dcc[idx].u.chat->channel >= 0)
-	      botnet_send_join_idx(idx, -1);
-	    return;
-	  } else if ((dcc[idx].sock != STDOUT) || backgrd) {
-	    killsock(dcc[idx].sock);
-	    lostdcc(idx);
-	    return;
-	  } else {
-	    dprintf(DP_STDOUT, "\n### SIMULATION RESET\n\n");
-	    dcc_chatter(idx);
-	    return;
-	  }
-	}
-      } else if (buf[0] == ',') {
+	check_tcl_dcc(v, idx, buf);
+    } else if (buf[0] == ',') {
 	int me = 0;
 
 	if ((buf[1] == 'm') && (buf[2] == 'e') && buf[3] == ' ')
@@ -979,7 +939,7 @@
 	    }
 	  }
 	}
-      } else if (buf[0] == '\'') {
+    } else if (buf[0] == '\'') {
 	int me = 0;
 
 	if ((buf[1] == 'm') && (buf[2] == 'e') &&
@@ -993,7 +953,7 @@
 	      dprintf(i, "=%s=> %s\n", dcc[idx].nick, buf + 1);
 	  }
 	}
-      } else {
+    } else {
 	if (dcc[idx].u.chat->away != NULL)
 	  not_away(idx);
 	if (dcc[idx].status & STAT_ECHO)
@@ -1006,7 +966,6 @@
 			 dcc[idx].u.chat->channel, buf);
 	check_tcl_chat(dcc[idx].nick, dcc[idx].u.chat->channel, buf);
       }
-    }
   }
   if (dcc[idx].type == &DCC_CHAT)	/* Could have change to files */
     if (dcc[idx].status & STAT_PAGE)
Index: eggdrop1.7/src/tcldcc.c
diff -u eggdrop1.7/src/tcldcc.c:1.31 eggdrop1.7/src/tcldcc.c:1.32
--- eggdrop1.7/src/tcldcc.c:1.31	Thu Sep 27 22:15:34 2001
+++ eggdrop1.7/src/tcldcc.c	Thu Oct  4 16:37:44 2001
@@ -2,7 +2,7 @@
  * tcldcc.c -- handles:
  *   Tcl stubs for the dcc commands
  *
- * $Id: tcldcc.c,v 1.31 2001/09/28 03:15:34 stdarg Exp $
+ * $Id: tcldcc.c,v 1.32 2001/10/04 21:37:44 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -218,14 +218,12 @@
 	botnet_send_part_idx(idx, "*script*");
       check_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
 		     dcc[idx].u.chat->channel);
-      check_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
     }
     dcc[idx].u.chat->channel = chan;
     if (chan < GLOBAL_CHANS)
       botnet_send_join_idx(idx, oldchan);
     check_tcl_chjn(botnetnick, dcc[idx].nick, chan, geticon(idx),
 		   dcc[idx].sock, dcc[idx].host);
-    check_chjn(botnetnick, dcc[idx].nick, chan, geticon(idx), dcc[idx].sock, dcc[idx].host);
   }
   /* Console autosave. */
   if ((me = module_find("console", 1, 1))) {
@@ -438,7 +436,6 @@
 		  dcc[idx].nick);
       check_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
 		     dcc[idx].u.chat->channel);
-      check_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
       botnet_send_part_idx(idx, "gone");
     }
     check_tcl_chof(dcc[idx].nick, dcc[idx].sock);
@@ -489,7 +486,6 @@
     botnet_send_part_idx(idx, argc == 3 ? argv[2] : "");
     if ((dcc[idx].u.chat->channel >= 0) && (dcc[idx].u.chat->channel < GLOBAL_CHANS)) {
       check_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
-      check_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
     }
     check_tcl_chof(dcc[idx].nick, dcc[idx].sock);
     /* Notice is sent to the party line, the script can add a reason. */
Index: eggdrop1.7/src/tclhash.c
diff -u eggdrop1.7/src/tclhash.c:1.37 eggdrop1.7/src/tclhash.c:1.38
--- eggdrop1.7/src/tclhash.c:1.37	Sat Sep 29 23:27:38 2001
+++ eggdrop1.7/src/tclhash.c	Thu Oct  4 16:37:45 2001
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.37 2001/09/30 04:27:38 stdarg Exp $
+ * $Id: tclhash.c,v 1.38 2001/10/04 21:37:45 stdarg Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1146,9 +1146,6 @@
     return 0;
   }
   if (x == BIND_NOMATCH) {
-    /* Temporary fix for special-case quit command. */
-    /* Later I'll fix the real quit command so that it's not special. */
-    if (!strcmp(cmd, "quit")) return(1);
     /* Check the new bind table. */
     check_bind(BT_dcc, cmd, &fr, dcc[idx].user, idx, args);
     return 0;
----------------------- End of diff -----------------------



More information about the Changes mailing list