Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_create.c
index 6333645ad15965a526aa03b45f25e188caea247d..f413c29ba4881f867f0fea770b9cb813a1207cb4 100644 (file)
@@ -97,6 +97,8 @@
 #include "numeric.h"
 #include "numnicks.h"
 #include "s_debug.h"
+#include "s_misc.h"
+#include "s_user.h"
 #include "send.h"
 
 #include <assert.h>
@@ -117,14 +119,12 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   struct ModeBuf mbuf; /* a mode buffer */
   int badop; /* a flag */
 
-  if (IsServer(sptr)) {
-    Debug((DEBUG_ERROR, "%s tried to CREATE a channel", sptr->name));
-    return 0;
-  }
+  if (IsServer(sptr))
+    return protocol_violation(sptr,"%s tried to CREATE a channel", cli_name(sptr));
 
   /* sanity checks: Only accept CREATE messages from servers */
   if (parc < 3 || *parv[2] == '\0')
-    return 0;
+    return need_more_params(sptr,"CREATE");
 
   chanTS = atoi(parv[2]);
 
@@ -136,17 +136,18 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
    */
   if (!IsBurstOrBurstAck(sptr) && 0 != chanTS &&
       MAGIC_REMOTE_JOIN_TS != chanTS)
-    sptr->user->server->serv->lag = TStime() - chanTS;
+    cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS;
 
-#if 0  
+#if 1
   /* If this server is >5 minutes fast, squit it */
   if (TStime() - chanTS<-5*60*60)
-       return exit_client(sptr,sptr,"Timestamp Drift/Bogus TS");
-       
+       return exit_client(sptr, sptr, &me, "Timestamp Drift/Bogus TS");
+#endif
+#if 0          
   /* If we recieve a CREATE for a channel from a server before that server
    * was linked, then it's a HACK
    */
-  if (MyConnect(sptr) && chanTS<sptr->timestamp+5*60*60)
+  if (MyConnect(sptr) && chanTS<cli_timestamp(sptr)+5*60*60)
        return exit_client(sptr,sptr,"HACK: Bogus TS on CREATE before server link");
 #endif