Fix typos in various comments.
[ircu2.10.12-pk.git] / ircd / m_create.c
index f496aae1a49c87edf803bb9f831a9fa95b063500..da94f5e51c3683dbeb67a0f8c418072cb02f34e7 100644 (file)
@@ -85,6 +85,7 @@
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "msg.h"
@@ -95,7 +96,7 @@
 #include "s_user.h"
 #include "send.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <stdlib.h>
 #include <string.h>
 
@@ -138,9 +139,6 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
                                      "SETTIME to correct this",
                                     cli_user(sptr)->server,
                                     chanTS - TStime());
-    /* If this server is >5 minutes fast, squit it */
-    if (TStime() - chanTS<-5*60*60)
-      return exit_client(sptr, sptr, &me, "Timestamp Drift/Bogus TS");
     /* Now issue a SETTIME to resync.  If we're in the wrong, our
      * (RELIABLE_CLOCK) hub will bounce a SETTIME back to us.
      */
@@ -151,8 +149,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   joinbuf_init(&join, sptr, cptr, JOINBUF_TYPE_JOIN, 0, 0);
   joinbuf_init(&create, sptr, cptr, JOINBUF_TYPE_CREATE, 0, chanTS);
 
-  
-  /* For each channel in the comma seperated list: */
+  /* For each channel in the comma separated list: */
   for (name = ircd_strtok(&p, parv[1], ","); name;
        name = ircd_strtok(&p, 0, ",")) {
     badop = 0;
@@ -162,7 +159,11 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
     if ((chptr = FindChannel(name)))
     {
-      name = chptr->chname;
+      /* Is the remote server confused? */
+      if (find_member_link(chptr, sptr)) {
+        protocol_violation(sptr, "%s tried to CREATE a channel already joined", cli_name(sptr));
+        continue;
+      }
 
       /* Check if we need to bounce a mode */
       if (TStime() - chanTS > TS_LAG_TIME ||
@@ -187,7 +188,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       chptr->creationtime = chanTS;
 
     joinbuf_join(badop ? &join : &create, chptr,
-                (badop || CHFL_CHANOP));
+                (badop ? 0 : CHFL_CHANOP));
   }
 
   joinbuf_flush(&join); /* flush out the joins and creates */