[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Wed Dec 19 22:54:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2001-12-20 04:53:38 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 language/core.english.lang
     language/core.french.lang language/core.german.lang src/lang.h
     src/misc.c

Log message:

cleaned up show_motd a bit and fixed a bug with show_banner not reseting help_subst

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.257 eggdrop1.6/doc/UPDATES1.6:1.258
--- eggdrop1.6/doc/UPDATES1.6:1.257	Wed Dec 19 01:30:58 2001
+++ eggdrop1.6/doc/UPDATES1.6	Wed Dec 19 22:53:27 2001
@@ -1,10 +1,13 @@
-$Id: UPDATES1.6,v 1.257 2001/12/19 07:30:58 guppy Exp $
+$Id: UPDATES1.6,v 1.258 2001/12/20 04:53:27 guppy Exp $
 
 Changes in eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.8
 Found by  Fixed by  What...
+          guppy     made show_banner reset the help_subst arguments like show_motd does
+                    and if the motd isn't a regular file, just return instead of giving
+                    an error like show_banner does
           guppy     tcl_jump could easily crash the bot
 various   guppy     tcl_pushmode now accepts any irc modes instead of the standard ones
           guppy     made tcl_chanlist (when matching chanflags), tcl_handonchan, and
Index: eggdrop1.6/language/core.english.lang
diff -u eggdrop1.6/language/core.english.lang:1.27 eggdrop1.6/language/core.english.lang:1.28
--- eggdrop1.6/language/core.english.lang:1.27	Fri Nov 30 22:31:29 2001
+++ eggdrop1.6/language/core.english.lang	Wed Dec 19 22:53:28 2001
@@ -1,7 +1,7 @@
 # core.english.lang
 #   core language messages for eggdrop
 #
-# $Id: core.english.lang,v 1.27 2001/12/01 04:31:29 guppy Exp $
+# $Id: core.english.lang,v 1.28 2001/12/20 04:53:28 guppy Exp $
 
 # General stuff
 0x001,Usage
@@ -188,7 +188,7 @@
 0x630,I don't know you; please introduce yourself first.
 0x631,No help.
 0x632,No help available on that.
-0x633,is not a normal file!
+# 0x633 - unused
 0x634,Not on that channel right now.
 0x635,Switching back to nick %s
 0x636,Server says my nickname is invalid.
Index: eggdrop1.6/language/core.french.lang
diff -u eggdrop1.6/language/core.french.lang:1.20 eggdrop1.6/language/core.french.lang:1.21
--- eggdrop1.6/language/core.french.lang:1.20	Sun Sep 23 23:25:39 2001
+++ eggdrop1.6/language/core.french.lang	Wed Dec 19 22:53:28 2001
@@ -1,7 +1,7 @@
 # core.french.lang
 #   core language messages for eggdrop
 #
-# $Id: core.french.lang,v 1.20 2001/09/24 04:25:39 guppy Exp $
+# $Id: core.french.lang,v 1.21 2001/12/20 04:53:28 guppy Exp $
 
 
 # General stuff
@@ -189,7 +189,7 @@
 0x630,Vous n'êtes pas enregistré ; présentez vous d'abord.
 0x631,Aucune aide.
 0x632,Aucune aide disponible là-dessus.
-0x633,n'est pas un fichier normal!
+# 0x633 - unused
 0x634,Pas sur ce canal en ce moment.
 0x635,Je récupère mon surnom (%s)
 0x636,Le serveur me dit que mon surnom est invalide.
Index: eggdrop1.6/language/core.german.lang
diff -u eggdrop1.6/language/core.german.lang:1.25 eggdrop1.6/language/core.german.lang:1.26
--- eggdrop1.6/language/core.german.lang:1.25	Sun Sep 23 23:25:39 2001
+++ eggdrop1.6/language/core.german.lang	Wed Dec 19 22:53:28 2001
@@ -6,7 +6,7 @@
 # Modified by Michael for 1.3.25.
 # Modified by rtc for 1.4.0
 #
-# $Id: core.german.lang,v 1.25 2001/09/24 04:25:39 guppy Exp $
+# $Id: core.german.lang,v 1.26 2001/12/20 04:53:28 guppy Exp $
 
 # General stuff
 0x001,Gebrauch
@@ -195,7 +195,7 @@
 0x630,Ich kenne Dich nicht, bitte stell Dich mir zuerst vor.
 0x631,Keine Hilfe.
 0x632,Keine Hilfe dazu verfuegbar.
-0x633,ist keine normale Datei!
+# 0x633 - unused
 0x634,Im Moment nicht auf diesem Channel.
 0x635,Wechsele zurueck zu Nickname %s
 0x636,Server sagt mein Nickname sei ungueltig.
Index: eggdrop1.6/src/lang.h
diff -u eggdrop1.6/src/lang.h:1.23 eggdrop1.6/src/lang.h:1.24
--- eggdrop1.6/src/lang.h:1.23	Sun Sep 23 23:25:39 2001
+++ eggdrop1.6/src/lang.h	Wed Dec 19 22:53:28 2001
@@ -2,7 +2,7 @@
  * lang.h
  *   Conversion definitions for language support
  *
- * $Id: lang.h,v 1.23 2001/09/24 04:25:39 guppy Exp $
+ * $Id: lang.h,v 1.24 2001/12/20 04:53:28 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -181,7 +181,6 @@
 #define IRC_DONTKNOWYOU		get_language(0x630)
 #define IRC_NOHELP		get_language(0x631)
 #define IRC_NOHELP2		get_language(0x632)
-#define IRC_NOTNORMFILE		get_language(0x633)
 #define IRC_NOTONCHAN		get_language(0x634)
 #define IRC_GETORIGNICK		get_language(0x635)
 #define IRC_BADBOTNICK		get_language(0x636)
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.45 eggdrop1.6/src/misc.c:1.46
--- eggdrop1.6/src/misc.c:1.45	Sun Dec  2 01:17:24 2001
+++ eggdrop1.6/src/misc.c	Wed Dec 19 22:53:28 2001
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.45 2001/12/02 07:17:24 guppy Exp $
+ * $Id: misc.c,v 1.46 2001/12/20 04:53:28 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1294,6 +1294,16 @@
     dprintf(idx, "%s\n", s);
 }
 
+/* This will return a pointer to the first character after the @ in the
+ * string given it.  Possibly it's time to think about a regexp library
+ * for eggdrop...
+ */
+char *extracthostname(char *hostmask)
+{
+  char *p = strrchr(hostmask, '@');
+  return p ? p + 1 : "";
+}
+
 /* Show motd to dcc chatter
  */
 void show_motd(int idx)
@@ -1302,67 +1312,61 @@
   char s[1024];
   struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
-  get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.chat->con_chan);
+  if (!is_file(motdfile))
+    return;
+
   vv = fopen(motdfile, "r");
-  if (vv != NULL) {
-    if (!is_file(motdfile)) {
-      fclose(vv);
-      dprintf(idx, "### MOTD %s\n", IRC_NOTNORMFILE);
-      return;
-    }
-    dprintf(idx, "\n");
-    help_subst(NULL, NULL, 0,
-	       (dcc[idx].status & STAT_TELNET) ? 0 : HELP_IRC, NULL);
-    while (!feof(vv)) {
-      fgets(s, 120, vv);
-      if (!feof(vv)) {
-	if (s[strlen(s) - 1] == '\n')
-	  s[strlen(s) - 1] = 0;
-	if (!s[0])
-	  strcpy(s, " ");
-	help_subst(s, dcc[idx].nick, &fr, 1, botnetnick);
-	if (s[0])
-	  dprintf(idx, "%s\n", s);
-      }
+  if (!vv)
+    return;
+
+  get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.chat->con_chan);
+  dprintf(idx, "\n");
+  /* reset the help_subst variables to their defaults */
+  help_subst(NULL, NULL, 0,
+	     (dcc[idx].status & STAT_TELNET) ? 0 : HELP_IRC, NULL);
+  while (!feof(vv)) {
+    fgets(s, 120, vv);
+    if (!feof(vv)) {
+      if (s[strlen(s) - 1] == '\n')
+	s[strlen(s) - 1] = 0;
+      if (!s[0])
+	strcpy(s, " ");
+      help_subst(s, dcc[idx].nick, &fr, 1, botnetnick);
+      if (s[0])
+	dprintf(idx, "%s\n", s);
     }
-    fclose(vv);
-    dprintf(idx, "\n");
   }
+  fclose(vv);
+  dprintf(idx, "\n");
 }
 
-/* This will return a pointer to the first character after the @ in the
- * string given it.  Possibly it's time to think about a regexp library
- * for eggdrop...
- */
-char *extracthostname(char *hostmask)
-{
-  char *p = strrchr(hostmask, '@');
-  return p ? p + 1 : "";
-}
-
-/* Show banner to telnet user (very simialer to show_motd)
+/* Show banner to telnet user 
  */
 void show_banner(int idx) {
-   FILE *vv;
-   char s[1024];
-   struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
+  FILE *vv;
+  char s[1024];
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
-   if (!is_file(bannerfile))
-      return;
-   get_user_flagrec(dcc[idx].user, &fr,dcc[idx].u.chat->con_chan);
-   vv = fopen(bannerfile, "r");
-   if (!vv)
-      return;
-   while(!feof(vv)) {
-      fgets(s, 120, vv);
-      if (!feof(vv)) {
-        if (!s[0])
-          strcpy(s, " \n");
-        help_subst(s, dcc[idx].nick, &fr, 1, botnetnick);
-        dprintf(idx, "%s", s);
-      }
-   }
-   fclose(vv);
+  if (!is_file(bannerfile))
+    return;
+
+  vv = fopen(bannerfile, "r");
+  if (!vv)
+    return;
+
+  get_user_flagrec(dcc[idx].user, &fr,dcc[idx].u.chat->con_chan);
+  /* reset the help_subst variables to their defaults */
+  help_subst(NULL, NULL, 0, 0, NULL);
+  while(!feof(vv)) {
+    fgets(s, 120, vv);
+    if (!feof(vv)) {
+      if (!s[0])
+	strcpy(s, " \n");
+      help_subst(s, dcc[idx].nick, &fr, 0, botnetnick);
+      dprintf(idx, "%s", s);
+    }
+  }
+  fclose(vv);
 }
 
 /* Create a string with random letters and digits
----------------------- End of diff -----------------------



More information about the Changes mailing list