Răsfoiți Sursa

Removed topicprot patch which was applied pre-wraith

svn: 61
Bryan Drewery 23 ani în urmă
părinte
comite
3141cb5f33

+ 0 - 1
src/chan.h

@@ -173,7 +173,6 @@ struct chanset_t {
   int mode_mns_prot;		/* modes to reject			*/
   int limit_prot;		/* desired limit			*/
   char key_prot[121];		/* desired password			*/
-  char topic_prot[501];		/* desired topic			*/
 /* Chanchar template
  *char temp[121];
  */

+ 0 - 19
src/chanprog.c

@@ -882,22 +882,3 @@ int isowner(char *name)
   }
 }
 
-/* If we have a protected topic and the bot is opped
- * or the channel is -t, change the topic. (Sup 11May2001)
- */
-void check_topic(struct chanset_t *chan)
-{
-  memberlist *m = NULL;  
-
-  if (chan->topic_prot[0]) {
-    m = ismember(chan, botname);
-    if (!m)
-      return;
-    if (chan->channel.topic) {
-      if (!egg_strcasecmp(chan->topic_prot, chan->channel.topic))
-	return;
-    }
-    if (chan_hasop(m) || !channel_optopic(chan))
-      dprintf(DP_SERVER, "TOPIC %s :%s\n", chan->name, chan->topic_prot);
-  }
-}

+ 0 - 1
src/mod/channels.mod/cmdschan.c

@@ -1396,7 +1396,6 @@ static void cmd_chaninfo(struct userrec *u, int idx, char *par)
 	    channel_static(chan) ? "static" : "dynamic", chan->dname);
     get_mode_protect(chan, work);
     dprintf(idx, "Protect modes (chanmode): %s\n", work[0] ? work : "None");
-    dprintf(idx, "Protect topic: %s\n", chan->topic_prot[0] ? chan->topic_prot : "None");
 /* Chanchar template
  *  dprintf(idx, "String temp: %s\n", chan->temp[0] ? chan->temp : "NULL");
  */

+ 8 - 11
src/mod/channels.mod/tclchan.c

@@ -1199,16 +1199,6 @@ static int tcl_channel_modify(Tcl_Interp * irp, struct chanset_t *chan,
  *    }
  *    chan->temp = atoi(item[i]);
  */
-    } else if (!strcmp(item[i], "topic")) {
-      i++;
-      if (i >= items) {
-	if (irp)
-	  Tcl_AppendResult(irp, "channel topic needs argument", NULL);
-	return TCL_ERROR;
-      }
-      strncpyz(chan->topic_prot, item[i], sizeof(chan->topic_prot));
-      check_topic(chan);
-    }
 /* Chanchar template
     } else if (!strcmp(item[i], "temp")) {
       i++;
@@ -1220,8 +1210,15 @@ static int tcl_channel_modify(Tcl_Interp * irp, struct chanset_t *chan,
       strncpyz(chan->temp, item[i], sizeof(chan->temp));
       //Entry just changed so update/recheck it's purpose?
       check_temp(chan);
-    }
  */
+    } else if (!strcmp(item[i], "topic")) { //this is here for compatability
+      i++;
+      if (i >= items) {
+        if (irp)
+          Tcl_AppendResult(irp, "channel topic needs argument", NULL);
+        return TCL_ERROR;
+      }
+    }
     else if (!strcmp(item[i], "+enforcebans"))
       chan->status |= CHAN_ENFORCEBANS;
     else if (!strcmp(item[i], "-enforcebans"))

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

@@ -1282,7 +1282,7 @@ static int write_chans(FILE *f, int idx)
 {
 
   char w[1024], w2[1024], name[163];
-  char topic[1002], udefs[2048] = "", sadd[5], buf[2048];
+  char udefs[2048] = "", sadd[5], buf[2048];
 /* Chanchar template
  *char temp[121];
  */
@@ -1312,7 +1312,6 @@ static int write_chans(FILE *f, int idx)
      convert_element(chan->dname, name);
      get_mode_protect(chan, w);
      convert_element(w, w2);
-     convert_element(chan->topic_prot, topic);
 /* Chanchar template
  *   convert_element(chan->temp, temp);
  */
@@ -1331,7 +1330,7 @@ static int write_chans(FILE *f, int idx)
    //insert the ending character into a string
      sprintf(sadd, "%s\n", channel_static(chan) ? "" : "}");
 
-     if (lfprintf(f, "+ channel %s %s%schanmode %s topic %s idle-kick %d limit %d stopnethack-mode %d \
+     if (lfprintf(f, "+ channel %s %s%schanmode %s idle-kick %d limit %d stopnethack-mode %d \
 revenge-mode %d \
 flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
 flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d \
@@ -1348,7 +1347,6 @@ exempt-time %d invite-time %d \
 	name,
 	channel_static(chan) ? " " : " { ",
 	w2,
-        topic,
 /* Chanchar template
  *      temp,
  * also include temp %s in dprintf.

+ 0 - 8
src/mod/irc.mod/cmdsirc.c

@@ -1279,7 +1279,6 @@ static void cmd_channel(struct userrec *u, int idx, char *par)
 static void cmd_topic(struct userrec *u, int idx, char *par)
 {
   struct chanset_t *chan;
-  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
   if (par[0] && (strchr(CHANMETA, par[0]) != NULL)) {
     char *chname = newsplit(&par);
@@ -1311,13 +1310,6 @@ static void cmd_topic(struct userrec *u, int idx, char *par)
       dprintf(idx, "I'm not a channel op on %s and the channel %s",
 		  "is +t.\n", chan->dname);
     } else {
-      if (chan->topic_prot[0]) {
-	get_user_flagrec(u, &fr, chan->dname);
-	if (!glob_master(fr) && !chan_master(fr)) {
-	  dprintf(idx, "The topic of %s is protected.\n", chan->dname);
-	  return;
-	}
-      }
       dprintf(DP_SERVER, "TOPIC %s :%s\n", chan->name, par);
       dprintf(idx, "Changing topic...\n");
       putlog(LOG_CMDS, "*", "#%s# (%s) topic %s", dcc[idx].nick,

+ 1 - 6
src/mod/irc.mod/mode.c

@@ -544,11 +544,8 @@ Context;
     }
   }
   m->flags |= WASOP;
-  if (check_chan) {
-Context;
+  if (check_chan)
     recheck_channel(chan, 1);
-    check_topic(chan);
-  }
 }
 
 static void got_deop(struct chanset_t *chan, char *nick, char *from,
@@ -1218,8 +1215,6 @@ Context;
 		     ((ms2[0] == '-') || (chan->mode_mns_prot & todo)))
 	      add_mode(chan, ms2[0] == '+' ? '-' : '+', *chg, "");
 	  }
-          if ((ms2[0] == '-') && ((*chg == 't') || (*chg == 'h')))
-            check_topic(chan);
 	}
 	chg++;
       }

+ 1 - 1
src/mod/module.h

@@ -360,7 +360,7 @@
 #define rem_tcl_coups ((void (*) (tcl_coups *))global[210])
 #define botname ((char *)(global[211]))
 /* 212 - 215 */
-#define check_topic ((void (*)(struct chanset_t *))global[212])
+/* 212: remove_gunk() -- UNUSED (drummer) */
 #define check_tcl_chjn ((void (*) (const char *,const char *,int,char,int,const char *))global[213])
 #define sanitycheck_dcc ((int (*)(char *, char *, char *, char *))global[214])
 #define isowner ((int (*)(char *))global[215])

+ 1 - 1
src/modules.c

@@ -402,7 +402,7 @@ Function global_table[] =
   (Function) rem_tcl_coups,
   (Function) botname,
   /* 212 - 215 */
-  (Function) check_topic,
+  (Function) 0,			/* remove_gunk() -- UNUSED! (drummer)	*/
   (Function) check_tcl_chjn,
   (Function) sanitycheck_dcc,
   (Function) isowner,

+ 0 - 1
src/proto.h

@@ -123,7 +123,6 @@ void check_timers();
 void set_chanlist(const char *host, struct userrec *rec);
 void clear_chanlist(void);
 void clear_chanlist_member(const char *nick);
-void check_topic(struct chanset_t *);
 
 /* cmds.c */
 int check_dcc_attrs(struct userrec *, int);