+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
#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 */
/*
* 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;
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;
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);
}
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;
}
#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)
{
/*
* send_reply(cptr, RPL_PROTOLIST, "stuff");
*/
+ sendcmdto_one(&me,CMD_PROTO,cptr,"%s unet1 1 1",PROTO_SUP);
return 0;
}
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;
}
/* 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 */
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;