From: Perry Lorier Date: Tue, 2 Jan 2001 01:53:34 +0000 (+0000) Subject: Author: Isomer X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=cb396c94ca182a7ebbe9e47f9908b93cc1594ad2 Author: Isomer 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 --- diff --git a/ChangeLog b/ChangeLog index 6558001..38e056b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-01-02 Perry Lorier + * 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 * ircd/m_ison.c (m_ison): Dianora says that ISON has to end with a diff --git a/include/numeric.h b/include/numeric.h index 051f2bc..a260249 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -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 */ diff --git a/ircd/channel.c b/ircd/channel.c index 114deb0..3208d71 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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; diff --git a/ircd/m_join.c b/ircd/m_join.c index b0d28d7..437a52f 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -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); } diff --git a/ircd/m_pass.c b/ircd/m_pass.c index 31a9046..5dee35b 100644 --- a/ircd/m_pass.c +++ b/ircd/m_pass.c @@ -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; } diff --git a/ircd/m_proto.c b/ircd/m_proto.c index fa82b58..85cf1c8 100644 --- a/ircd/m_proto.c +++ b/ircd/m_proto.c @@ -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" @@ -108,6 +109,7 @@ 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; } diff --git a/ircd/s_err.c b/ircd/s_err.c index b5a3a94..e887eb3 100644 --- a/ircd/s_err.c +++ b/ircd/s_err.c @@ -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 */ diff --git a/ircd/s_numeric.c b/ircd/s_numeric.c index 5d9803c..5451ad1 100644 --- a/ircd/s_numeric.c +++ b/ircd/s_numeric.c @@ -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;