Author: Isomer <isomer@coders.net>
authorPerry Lorier <isomer@undernet.org>
Tue, 2 Jan 2001 01:53:34 +0000 (01:53 +0000)
committerPerry Lorier <isomer@undernet.org>
Tue, 2 Jan 2001 01:53:34 +0000 (01:53 +0000)
Log message:

* Added HekTik's fix to guppy's /msg's go to -n+m channels.

* Protocol violation stuff

* Protocol negotiation stuffs

* added another param to 004 for modes that have parameters.

* Ripped out more P09 crap.

* Probably buggered the entire thing up.

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

ChangeLog
include/numeric.h
ircd/channel.c
ircd/m_join.c
ircd/m_pass.c
ircd/m_proto.c
ircd/s_err.c
ircd/s_numeric.c

index 655800148005ac9f3f4d9e8a784373c5d7084f25..38e056bcff6a0bb9089f3c93b9d5b4426b09cf56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-01-02  Perry Lorier <isomer@coders.net>
+       * ircd/s_err.c: Added third param to 004 - the channel modes that tage params.  Used by hybrid/epic.
+       * ircd/s_channels.c: Added fix for msg'ing a -n+m channel - thanks
+               to guppy for noticing, and hektik for providing the fix.
+       * misc others: Minor cleanups, added more protocol_violations, ripped
+               out more P09 stuffs, bit more protocol neg stuff.
+
 2000-12-19  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * ircd/m_ison.c (m_ison): Dianora says that ISON has to end with a
index 051f2bca5512e9869b85d6a2c886a0df4622f97e..a260249eacee18bc0de2c3cb2679ffd871d4e86a 100644 (file)
@@ -56,6 +56,7 @@ extern const struct Numeric* get_error_numeric(int err);
 #define RPL_SNOMASK            8        /* Undernet extension */
 #define RPL_STATMEMTOT         9        /* Undernet extension */
 #define RPL_STATMEM           10        /* Undernet extension */
+                                       /* Hybrid: server redirect */
 /*      RPL_YOURCOOKIE        14           IRCnet extension */
 #define RPL_MAP               15        /* Undernet extension */
 #define RPL_MAPMORE           16        /* Undernet extension */
index 114deb0938487e662f8c07961fd0a8827ebb2468..3208d71492d8b8a1fdd31024859ebe3686f3f0a8 100644 (file)
@@ -696,10 +696,11 @@ int client_can_send_to_channel(struct Client *cptr, struct Channel *chptr)
 
   /*
    * You can't speak if your off channel, if the channel is modeless, or
-   * +n.(no external messages)
+   * +n (no external messages) or +m (moderated).
    */
   if (!member) {
-    if ((chptr->mode.mode & MODE_NOPRIVMSGS) || IsModelessChannel(chptr->chname)) 
+    if ((chptr->mode.mode & (MODE_NOPRIVMSGS|MODE_MODERATED)) 
+       || IsModelessChannel(chptr->chname)) 
       return 0;
     else
       return 1;
index b0d28d7729afc24c129fbd81ef83bb4312bfb162..437a52f2bbb58be6ee6009f3049427898c268d38 100644 (file)
@@ -317,10 +317,24 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */
       continue;
 
-    if (IsLocalChannel(name) || !IsChannelName(name))
+    if (IsLocalChannel(name) || !IsChannelName(name)) {
+      protocol_violation(sptr,"%s tried to join %s",cli_name(cptr),name);
       continue;
+    }
 
-    if ((chptr = FindChannel(name))) {
+    if (!(chptr = FindChannel(name))) {
+      /* No channel exists, so create one */
+      if (!(chptr = get_channel(sptr, name, CGT_CREATE))) {
+        protocol_violation(sptr,"couldn't get channel %s for %s",
+                          name,cli_name(sptr));
+       continue;
+      }
+      flags = CHFL_DEOPPED | ((cli_flags(sptr) & FLAGS_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;
+    }
+    else { /* We have a valid channel? */
       if ((member = find_member_link(chptr, sptr))) {
        if (!IsZombie(member)) /* already on channel */
          continue;
@@ -330,14 +344,7 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
        chptr = FindChannel(name);
       } else
        flags = CHFL_DEOPPED | ((cli_flags(sptr) & FLAGS_TS8) ? CHFL_SERVOPOK : 0);
-    } else {
-      flags = CHFL_DEOPPED | ((cli_flags(sptr) & FLAGS_TS8) ? CHFL_SERVOPOK : 0);
-
-      if ((chptr = get_channel(sptr, name, CGT_CREATE)))
-       chptr->creationtime = creation ? creation : MAGIC_REMOTE_JOIN_TS;
-      else
-       continue; /* couldn't get channel */
-    }
+    } 
 
     joinbuf_join(&join, chptr, flags);
   }
index 31a9046c4912486a62c9370a884ac7245e6d54fa..5dee35bcf129bcb43e261630d503a8b57685991d 100644 (file)
@@ -137,6 +137,10 @@ int m_pass(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]); /* XXX DEAD */
     return 0;
   }
+  if (ircd_strcmp("PROTO",password)) {
+       proto_send_supported(sptr);
+       return 0;
+  }
   ircd_strncpy(cptr->passwd, password, PASSWDLEN);
   return 0;
 }
index fa82b589eeb9d9aa2ba2f32b3cb7870ddfa5122e..85cf1c80d646310866e7f672b237ff436dbcf509 100644 (file)
@@ -36,6 +36,7 @@
 #include "ircd_chattr.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
+#include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
 #include "s_debug.h"
 
 static const char* const PROTO_REQ = "REQ";
 static const char* const PROTO_ACK = "ACK";
+static const char* const PROTO_SUP = "SUP";
 
 int proto_handle_ack(struct Client* cptr, const char* msg)
 {
@@ -132,6 +134,7 @@ int proto_send_supported(struct Client* cptr)
   /*
    * send_reply(cptr, RPL_PROTOLIST, "stuff");
    */
+  sendcmdto_one(&me,CMD_PROTO,cptr,"%s unet1 1 1",PROTO_SUP);
   return 0;
 }
 
@@ -148,6 +151,9 @@ int m_proto(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   else if (0 == ircd_strcmp(PROTO_ACK, parv[1]))
     return proto_handle_ack(cptr, parv[2]);
+    
+  else if (0 == ircd_strcmp(PROTO_SUP, parv[1]))
+    return 0; /* ignore it */
 
   return 0;
 }
index b5a3a942f83c435ac4168fe35892d9ebf54d2652..e887eb339c44c08af8447574c2f78d2d7077ef3b 100644 (file)
@@ -35,7 +35,7 @@ static Numeric replyTable[] = {
 /* 003 */
   { RPL_CREATED, ":This server was created %s", "003" },
 /* 004 */
-  { RPL_MYINFO, "%s %s dioswkg biklmnopstv", "004" },
+  { RPL_MYINFO, "%s %s dioswkg biklmnopstv bklov", "004" },
 /* 005 */
   { RPL_ISUPPORT, "%s :are supported by this server", "005" },
 /* 006 */
index 5d9803c43114500e47b7514eb067deaf040c8858..5451ad16ac9ad4c6fb94836526653bc1689e087a 100644 (file)
@@ -67,6 +67,10 @@ int do_numeric(int numeric, int nnn, struct Client *cptr, struct Client *sptr,
     return 0;
 
   /* Remap low number numerics, not that I understand WHY.. --Nemesi  */
+  /* numerics below 100 talk about the current 'connection', you're not
+   * connected to a remote server so it doesn't make sense to send them
+   * remotely - but the information they contain may be useful, so we
+   * remap them up.  Weird, but true.  -- Isomer */
   if (numeric < 100)
     numeric += 100;