File: moderation.hack

package info (click to toggle)
ircd 2.10.04-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,248 kB
  • ctags: 2,145
  • sloc: ansic: 26,591; makefile: 666; sh: 418; perl: 18
file content (61 lines) | stat: -rw-r--r-- 2,778 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --minimal --new-file --recursive --show-c-function --unified=3 build/ircd/channel.c work/ircd/channel.c
--- build/ircd/channel.c	Sat May  9 11:31:46 1998
+++ work/ircd/channel.c	Sat May  9 11:36:17 1998
@@ -2355,7 +2355,13 @@ int m_join(aClient *cptr, aClient *sptr,
       /*
        * Notify all other users on the new channel
        */
-      sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s", parv[0], name);
+      if (!(chptr->mode.mode & MODE_MODERATED))
+	sendto_channel_butserv(chptr, sptr, ":%s JOIN :%s", parv[0], name);
+      else
+      {
+	sendto_lchanops_butone(sptr, sptr, chptr, ":%s JOIN :%s", parv[0], name);
+	sendto_prefix_one(sptr, sptr, ":%s JOIN :%s", parv[0], name);
+      }
 
       if (MyClient(sptr))
       {
@@ -3425,9 +3431,15 @@ int m_part(aClient *cptr, aClient *sptr,
     if (!(lp->flags & CHFL_ZOMBIE))
     {
       if (comment)
-	sendto_channel_butserv(chptr, sptr, PartFmt2, parv[0], name, comment);
+	(chptr->mode.mode & MODE_MODERATED)
+	  ? sendto_lchanops_butone(sptr, sptr, chptr, PartFmt2, parv[0], name, comment),
+	  sendto_prefix_one(sptr, sptr, PartFmt2, parv[0], name, comment)
+	  : sendto_channel_butserv(chptr, sptr, PartFmt2, parv[0], name, comment);
       else
-	sendto_channel_butserv(chptr, sptr, PartFmt1, parv[0], name);
+	(chptr->mode.mode & MODE_MODERATED)
+	  ? sendto_lchanops_butone(sptr, sptr, chptr, PartFmt1, parv[0], name),
+	  sendto_prefix_one(sptr, sptr, PartFmt1, parv[0], name)
+	  : sendto_channel_butserv(chptr, sptr, PartFmt1, parv[0], name);
     }
     else if (MyClient(sptr))
     {
diff --minimal --new-file --recursive --show-c-function --unified=3 build/ircd/s_user.c work/ircd/s_user.c
--- build/ircd/s_user.c	Sat May  9 11:31:46 1998
+++ work/ircd/s_user.c	Sat May  9 11:42:26 1998
@@ -1241,7 +1241,8 @@ nickkilldone:
     if (MyClient(sptr))
     {
       for (lp = cptr->user->channel; lp; lp = lp->next)
-	if (can_send(cptr, lp->value.chptr) == MODE_BAN)
+	if (can_send(cptr, lp->value.chptr) == MODE_BAN
+	    || lp->value.chptr->mode.mode & MODE_MODERATED)
 	{
 	  sendto_one(cptr, err_str(ERR_BANNICKCHANGE), me.name, parv[0],
 	      lp->value.chptr->chname);
diff --minimal --new-file --recursive --show-c-function --unified=3 build/ircd/send.c work/ircd/send.c
--- build/ircd/send.c	Sat May  9 11:31:46 1998
+++ work/ircd/send.c	Sat May  9 11:36:17 1998
@@ -401,7 +401,7 @@ void sendto_lchanops_butone(aClient *one
   {
     acptr = lp->value.cptr;
     if (acptr == one ||		    /* ...was the one I should skip */
-	!(lp->flags & CHFL_CHANOP) ||	    /* Skip non chanops */
+	(!(lp->flags & CHFL_CHANOP) && !IsAnOper(acptr)) ||	    /* Skip non chanops */
 	(lp->flags & CHFL_ZOMBIE) || IsDeaf(acptr))
       continue;
     if (MyConnect(acptr))	/* (It is always a client) */