From: Kevin L. Mitchell Date: Fri, 23 Dec 2005 17:12:06 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=411df45b6a2410b07e62affaaa3e07a4e9d45e2d Author: Kev Log message: Get rid of MAGIC_REMOTE_JOIN_TS--hasn't been needed for a long time, we've just been lazy. Also, fix two bugs having to do with remote users joining channels: 1) If the timestamps were the same, everybody got deopped; 2) the deops weren't actually happening, just shown. Now, the deops actually happen, and the deop loop is only entered if the remote join TS is older (less than) the channel timestamp or if the channel is a zannel. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1580 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index b9fc05a..6313beb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-12-23 Kevin L. Mitchell + + * ircd/m_join.c: get rid of MAGIC_REMOTE_JOIN_TS; perform the + deop-other-users loop only when creation < channel timestamp or + when the channel in question happens to be a zannel; actually deop + users, don't just say we are and not do it + + * ircd/m_create.c (ms_create): get rid of MAGIC_REMOTE_JOIN_TS + + * include/channel.h: get rid of MAGIC_REMOTE_JOIN_TS + 2005-12-13 Michael Poole * configure.in: Define a macro when compiling on Solaris. diff --git a/include/channel.h b/include/channel.h index f14bd78..b899e27 100644 --- a/include/channel.h +++ b/include/channel.h @@ -163,15 +163,6 @@ typedef enum ChannelGetType { */ #define TS_LAG_TIME 86400 -/** - * A Magic TS that is used for channels that are created by JOIN, - * a channel with this TS accepts all TS without complaining that - * it might receive later via MODE or CREATE. - * - * Part of the P9 compatibility, shouldn't occur on a P10 network. - */ -#define MAGIC_REMOTE_JOIN_TS 1270080000 - extern const char* const PartFmt1; diff --git a/ircd/m_create.c b/ircd/m_create.c index 6cb3db2..e27e566 100644 --- a/ircd/m_create.c +++ b/ircd/m_create.c @@ -126,8 +126,7 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* A create that didn't appear during a burst has that servers idea of * the current time. Use it for lag calculations. */ - if (!IsBurstOrBurstAck(sptr) && 0 != chanTS && - MAGIC_REMOTE_JOIN_TS != chanTS) + if (!IsBurstOrBurstAck(sptr) && 0 != chanTS) cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS; /* If this server is >1 minute fast, warn */ @@ -168,7 +167,6 @@ int ms_create(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* Check if we need to bounce a mode */ if (TStime() - chanTS > TS_LAG_TIME || (chptr->creationtime && chanTS > chptr->creationtime && - chptr->creationtime != MAGIC_REMOTE_JOIN_TS && /* Accept CREATE for zannels. This is only really necessary on a network with servers prior to 2.10.12.02: we just accept their TS and ignore the fact that it was a zannel. The influence of this on a network diff --git a/ircd/m_join.c b/ircd/m_join.c index 7bd6b1a..cec6357 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -340,8 +340,7 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) } flags |= HasFlag(sptr, FLAG_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; + chptr->creationtime = creation; } else { /* We have a valid channel? */ if ((member = find_member_link(chptr, sptr))) @@ -376,8 +375,8 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) non-existent, it does not bounce the create with the newer timestamp.) */ - if (creation && creation - ((!chptr->mode.apass[0] && chptr->users == 0) ? 1 : 0) <= chptr->creationtime) - { + if (creation && (creation < chptr->creationtime || + (!chptr->mode.apass[0] && chptr->users == 0))) { struct Membership *member; struct ModeBuf mbuf; @@ -389,8 +388,10 @@ int ms_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) modebuf_init(&mbuf, sptr, cptr, chptr, MODEBUF_DEST_CHANNEL | MODEBUF_DEST_HACK3 | MODEBUF_DEST_SERVER); for (member = chptr->members; member; member = member->next_member) { - if (IsChanOp(member)) + if (IsChanOp(member)) { modebuf_mode_client(&mbuf, MODE_DEL | MODE_CHANOP, member->user, OpLevel(member)); + member->status &= ~CHFL_CHANOP; + } } modebuf_flush(&mbuf); }