Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Fri, 23 Dec 2005 17:12:06 +0000 (17:12 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Fri, 23 Dec 2005 17:12:06 +0000 (17:12 +0000)
Log message:

Get rid of MAGIC_REMOTE_JOIN_TS--hasn't been needed for a long time, we've
just been lazy.  Also, fix two bugs having to do with remote users joining
channels: 1) If the timestamps were the same, everybody got deopped; 2) the
deops weren't actually happening, just shown.  Now, the deops actually
happen, and the deop loop is only entered if the remote join TS is older
(less than) the channel timestamp or if the channel is a zannel.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1580 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/channel.h
ircd/m_create.c
ircd/m_join.c

index b9fc05ac93cc824bf48e747fcc0b07d2fb84e98a..6313bebe90eee4c553833f182c81b50b9114b590 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-12-23  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * ircd/m_join.c: get rid of MAGIC_REMOTE_JOIN_TS; perform the
+       deop-other-users loop only when creation < channel timestamp or
+       when the channel in question happens to be a zannel; actually deop
+       users, don't just say we are and not do it
+
+       * ircd/m_create.c (ms_create): get rid of MAGIC_REMOTE_JOIN_TS
+
+       * include/channel.h: get rid of MAGIC_REMOTE_JOIN_TS
+
 2005-12-13  Michael Poole <mdpoole@troilus.org>
 
        * configure.in: Define a macro when compiling on Solaris.
index f14bd784fbdceaa17996d6bbd7aab6b843c21e53..b899e272422a4a4bb62be924d0fbb0177bfd989b 100644 (file)
@@ -163,15 +163,6 @@ typedef enum ChannelGetType {
  */
 #define TS_LAG_TIME 86400
 
-/**
- * A Magic TS that is used for channels that are created by JOIN,
- * a channel with this TS accepts all TS without complaining that
- * it might receive later via MODE or CREATE.
- *
- * Part of the P9 compatibility, shouldn't occur on a P10 network.
- */
-#define MAGIC_REMOTE_JOIN_TS 1270080000
-
 
 
 extern const char* const PartFmt1;
index 6cb3db2c80d6673a863173355e232a4a7795172a..e27e56649fda939dd8fa0333a8b3d2ee49fa43f1 100644 (file)
@@ -126,8 +126,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   /* A create that didn't appear during a burst has that servers idea of
    * the current time.  Use it for lag calculations.
    */
-  if (!IsBurstOrBurstAck(sptr) && 0 != chanTS &&
-      MAGIC_REMOTE_JOIN_TS != chanTS)
+  if (!IsBurstOrBurstAck(sptr) && 0 != chanTS)
     cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS;
 
   /* If this server is >1 minute fast, warn */
@@ -168,7 +167,6 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       /* Check if we need to bounce a mode */
       if (TStime() - chanTS > TS_LAG_TIME ||
          (chptr->creationtime && chanTS > chptr->creationtime &&
-          chptr->creationtime != MAGIC_REMOTE_JOIN_TS &&
           /* Accept CREATE for zannels. This is only really necessary on a network
              with servers prior to 2.10.12.02: we just accept their TS and ignore
              the fact that it was a zannel. The influence of this on a network
index 7bd6b1a5cb6b06a3084d79c9e122ed9a4556974c..cec63571b75a29dc5267787dff552f0917f36f5c 100644 (file)
@@ -340,8 +340,7 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       }
       flags |= HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0;
 
-      /* when the network is 2.10.11+ then remove MAGIC_REMOTE_JOIN_TS */
-      chptr->creationtime = creation ? creation : MAGIC_REMOTE_JOIN_TS;
+      chptr->creationtime = creation;
     }
     else { /* We have a valid channel? */
       if ((member = find_member_link(chptr, sptr)))
@@ -376,8 +375,8 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
          non-existent, it does not bounce the create with the newer
          timestamp.)
       */
-      if (creation && creation - ((!chptr->mode.apass[0] && chptr->users == 0) ? 1 : 0) <= chptr->creationtime)
-      {
+      if (creation && (creation < chptr->creationtime ||
+                      (!chptr->mode.apass[0] && chptr->users == 0))) {
         struct Membership *member;
         struct ModeBuf mbuf;
 
@@ -389,8 +388,10 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
         modebuf_init(&mbuf, sptr, cptr, chptr, MODEBUF_DEST_CHANNEL | MODEBUF_DEST_HACK3 | MODEBUF_DEST_SERVER);
         for (member = chptr->members; member; member = member->next_member)
         {
-          if (IsChanOp(member))
+          if (IsChanOp(member)) {
             modebuf_mode_client(&mbuf, MODE_DEL | MODE_CHANOP, member->user, OpLevel(member));
+           member->status &= ~CHFL_CHANOP;
+         }
         }
         modebuf_flush(&mbuf);
       }