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

* Removed share_greet and made always true.
* Removed some tcl vars, traces in channels.mod


svn: 315

Bryan Drewery 22 лет назад
Родитель
Сommit
8c9f2a1884
8 измененных файлов с 17 добавлено и 116 удалено
  1. 0 93
      src/mod/channels.mod/channels.c
  2. 1 2
      src/mod/channels.mod/userchan.c
  3. 1 1
      src/mod/module.h
  4. 1 1
      src/mod/share.mod/share.c
  5. 2 2
      src/modules.c
  6. 9 10
      src/tcl.c
  7. 1 4
      src/userent.c
  8. 2 3
      src/userrec.c

+ 0 - 93
src/mod/channels.mod/channels.c

@@ -843,54 +843,7 @@ static int channels_expmem()
     tot += strlen(lastdeletedmask) + 1;
   return tot;
 }
-#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
-static char *traced_globchanset(ClientData cdata, Tcl_Interp * irp,
-                               CONST char *name1, CONST char *name2,
-                                int flags)
-#else
-static char *traced_globchanset(ClientData cdata, Tcl_Interp * irp, 
-                                char *name1, char *name2, int flags)
-#endif
-{
-  char *t, *s;
-  int i;
-  int items;
-#if (((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)) || (TCL_MAJOR_VERSION > 8))
-  CONST char **item, *s2;
-#else
-  char **item, *s2;
-#endif
 
-  if (flags & (TCL_TRACE_READS | TCL_TRACE_UNSETS)) {
-    Tcl_SetVar2(interp, name1, name2, glob_chanset, TCL_GLOBAL_ONLY);
-    if (flags & TCL_TRACE_UNSETS)
-      Tcl_TraceVar(interp, "global-chanset",
-	    TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
-	    traced_globchanset, NULL);
-  } else { /* Write */
-    s2 = Tcl_GetVar2(interp, name1, name2, TCL_GLOBAL_ONLY);
-    Tcl_SplitList(interp, s2, &items, &item);
-    for (i = 0; i<items; i++) {
-      if (!(item[i]) || (strlen(item[i]) < 2)) continue;
-      s = glob_chanset;
-      while (s[0]) {
-	t = strchr(s, ' '); /* Can't be NULL coz of the extra space */
-	t[0] = 0;
-	if (!strcmp(s + 1, item[i] + 1)) {
-	  s[0] = item[i][0]; /* +- */
-	  t[0] = ' ';
-	  break;
-	}
-	t[0] = ' ';
-	s = t + 1;
-      }
-    }
-    if (item) /* hmm it cant be 0 */
-      Tcl_Free((char *) item);
-    Tcl_SetVar2(interp, name1, name2, glob_chanset, TCL_GLOBAL_ONLY);
-  }
-  return NULL;
-}
 cmd_t channels_bot[] = {
   {"cjoin",    "", (Function) got_cjoin, NULL},
   {"cpart",    "", (Function) got_cpart, NULL},
@@ -913,45 +866,6 @@ cmd_t channels_bot[] = {
   {0, 0, 0, 0}
 };
 
-static tcl_ints my_tcl_ints[] =
-{
-  {"share-greet",		NULL,				0},
-  {"use-info",			&use_info,			0},
-  {"quiet-save",		&quiet_save,			0},
-  {"global-stopnethack-mode",	&global_stopnethack_mode,	0},
-  {"global-revenge-mode",       &global_revenge_mode,           0},
-  {"global-idle-kick",		&global_idle_kick,		0},
-  {"global-ban-time",           &global_ban_time,               0},
-#ifdef S_IRCNET
-  {"global-exempt-time",        &global_exempt_time,            0},
-  {"global-invite-time",        &global_invite_time,            0},
-#endif
-  /* keeping [ban|exempt|invite]-time for compatability <Wcc[07/20/02]> */
-  {"ban-time",                  &global_ban_time,               0},
-#ifdef S_IRCNET
-  {"exempt-time",               &global_exempt_time,            0},
-  {"invite-time",               &global_invite_time,            0},
-#endif
-  {NULL,			NULL,				0}
-};
-
-static tcl_coups mychan_tcl_coups[] =
-{
-  {"global-flood-chan",		&gfld_chan_thr,		&gfld_chan_time},
-  {"global-flood-deop",		&gfld_deop_thr,		&gfld_deop_time},
-  {"global-flood-kick",		&gfld_kick_thr,		&gfld_kick_time},
-  {"global-flood-join",		&gfld_join_thr,		&gfld_join_time},
-  {"global-flood-ctcp",		&gfld_ctcp_thr,		&gfld_ctcp_time},
-  {"global-flood-nick",		&gfld_nick_thr, 	&gfld_nick_time},
-  {NULL,			NULL,			NULL}
-};
-
-static tcl_strings my_tcl_strings[] =
-{
-  {"global-chanmode",	glob_chanmode,	64,	0},
-  {NULL,		NULL,		0,	0}
-};
-
 EXPORT_SCOPE char *channels_start();
 
 static Function channels_table[] =
@@ -1189,17 +1103,10 @@ char *channels_start(Function * global_funcs)
 #endif /* S_IRCNET */
   add_hook(HOOK_USERFILE, (Function) channels_writeuserfile);
   add_hook(HOOK_10SECONDLY, (Function) channels_checkslowjoin);
-  Tcl_TraceVar(interp, "global-chanset",
-	       TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS,
-	       traced_globchanset, NULL);
   add_builtins(H_chon, my_chon);
   add_builtins(H_dcc, C_dcc_irc);
   add_builtins(H_bot, channels_bot);
   add_tcl_commands(channels_cmds);
-  add_tcl_strings(my_tcl_strings);
-  my_tcl_ints[0].val = &share_greet;
-  add_tcl_ints(my_tcl_ints);
-  add_tcl_coups(mychan_tcl_coups);
 #ifdef S_AUTOLOCK
   add_cfg(&CFG_LOCKTHRESHOLD);
   add_cfg(&CFG_KILLTHRESHOLD);

+ 1 - 2
src/mod/channels.mod/userchan.c

@@ -99,8 +99,7 @@ static void set_handle_chaninfo(struct userrec *bu, char *handle,
   } else
     ch->info = NULL;
   cst = findchan_by_dname(chname);
-  if ((!noshare) && (bu == userlist) &&
-      !(u->flags & (USER_UNSHARED | USER_BOT)) && share_greet) {
+  if ((!noshare) && (bu == userlist) && !(u->flags & (USER_UNSHARED | USER_BOT))) {
     shareout(cst, "chchinfo %s %s %s\n", handle, chname, info ? info : "");
   }
 }

+ 1 - 1
src/mod/module.h

@@ -226,7 +226,7 @@
 #define global_bans (*(maskrec **)(global[96]))
 #define global_ign (*(struct igrec **)(global[97]))
 #define password_timeout (*(int *)(global[98]))
-#define share_greet (*(int *)global[99])
+/* UNUSED -- 99 */
 /* 100 - 103 */
 #define max_dcc (*(int *)global[100])
 #define shouldjoin ((int (*) (struct chanset_t *))global[101])

+ 1 - 1
src/mod/share.mod/share.c

@@ -637,7 +637,7 @@ static void share_chchinfo(int idx, char *par)
   if ((dcc[idx].status & STAT_SHARE) && !private_user) {
     hand = newsplit(&par);
     if ((u = get_user_by_handle(userlist, hand)) &&
-	!(u->flags & USER_UNSHARED) && share_greet) {
+	!(u->flags & USER_UNSHARED)) {
       chan = newsplit(&par);
       cst = findchan_by_dname(chan);
       fr.match = (FR_CHAN | FR_BOT);

+ 2 - 2
src/modules.c

@@ -35,7 +35,7 @@ extern int	 	 noshare, loading, role, server_lag,
  			 dcc_total, egg_numver, userfile_perm,
 			 use_console_r, ignore_time, must_be_owner,
 			 debug_output, default_flags,  
-			 max_dcc, share_greet, password_timeout, localhub,
+			 max_dcc, password_timeout, localhub,
 #ifdef S_IRCNET
 			 use_invites, use_exempts, 
 #endif
@@ -278,7 +278,7 @@ Function global_table[] =
   (Function) & global_bans,	 /* struct banrec *			*/
   (Function) & global_ign,	 /* struct igrec *			*/
   (Function) & password_timeout, /* int					*/
-  (Function) & share_greet,	 /* int					*/
+  (Function) 0,
   /* 100 - 103 */
   (Function) & max_dcc,		 /* int					*/
   (Function) shouldjoin, 

+ 9 - 10
src/tcl.c

@@ -31,22 +31,21 @@ typedef struct {
 } intinfo;
 
 extern time_t	online_since;
-extern int	backgrd, flood_telnet_thr, flood_telnet_time;
-extern int	shtime, share_greet;
-extern int	allow_new_telnets, use_telnet_banner;
-extern int	default_flags, conmask, connect_timeout;
-extern int	firewallport, notify_users_at, flood_thr, ignore_time;
-extern int	reserved_port_min, reserved_port_max, localhub;
+extern int	backgrd, flood_telnet_thr, flood_telnet_time,
+		shtime, allow_new_telnets, use_telnet_banner,
+		default_flags, conmask, connect_timeout,
+		firewallport, notify_users_at, flood_thr, ignore_time,
+		reserved_port_min, reserved_port_max, localhub,
+		enable_simul, dcc_total, debug_output, identtimeout,
+		protect_telnet, dupwait_timeout, egg_numver, share_unlinks,
+		dcc_sanitycheck, sort_users, tands, resolve_timeout,
+		default_uflags, strict_host, userfile_perm;
 extern char	origbotname[], botuser[], motdfile[], admin[], userfile[],
                 firewall[], notify_new[], hostname[], hostname6[], myip[], myip6[],
 		tempdir[], owner[], network[], botnetnick[],
 		bannerfile[], egg_version[], natip[], 
 		textdir[], pid_file[], dcc_prefix[];
 
-extern int	enable_simul, dcc_total, debug_output, identtimeout,
-		protect_telnet, dupwait_timeout, egg_numver, share_unlinks,
-		dcc_sanitycheck, sort_users, tands, resolve_timeout,
-		default_uflags, strict_host, userfile_perm;
 extern struct dcc_t	*dcc;
 extern tcl_timer_t	*timer, *utimer;
 

+ 1 - 4
src/userent.c

@@ -15,7 +15,6 @@ extern Tcl_Interp	*interp;
 extern char		 whois_fields[], botnetnick[];
 extern time_t            now;
 
-int share_greet = 0;		/* Share greeting info			*/
 static struct user_entry_type *entry_type_list;
 
 
@@ -132,9 +131,7 @@ int def_set(struct userrec *u, struct user_entry *e, void *buf)
     e->u.string = NULL;
   }
   if (!noshare && !(u->flags & (USER_BOT | USER_UNSHARED))) {
-    if (e->type != &USERENTRY_INFO || share_greet)
-      shareout(NULL, "c %s %s %s\n", e->type->name, u->handle,
-	       e->u.string ? e->u.string : "");
+    shareout(NULL, "c %s %s %s\n", e->type->name, u->handle, e->u.string ? e->u.string : "");
   }
   return 1;
 }

+ 2 - 3
src/userrec.c

@@ -16,7 +16,7 @@
 extern struct dcc_t	*dcc;
 extern struct chanset_t	*chanset;
 extern int		 default_flags, default_uflags, quiet_save,
-			 dcc_total, share_greet;
+			 dcc_total;
 extern char		 userfile[], ver[], botnetnick[], tempdir[];
 extern time_t		 now;
 
@@ -406,8 +406,7 @@ int write_user(struct userrec *u, FILE * f, int idx)
 	fr.udef_chan = ch->flags_udef;
 	build_flags(s, &fr, NULL);
 	if (lfprintf(f, "! %-20s %lu %-10s %s\n", ch->channel, ch->laston, s,
-		    (((idx < 0) || share_greet) && ch->info) ? ch->info
-		    : "") == EOF)
+		    ch->info ? ch->info : "") == EOF)
 	  return 0;
       }
     }