From 63ece5f2bcdee8a3330ca56a34b130c1d4ed0d0a Mon Sep 17 00:00:00 2001 From: stskeeps Date: Sun, 25 Aug 2002 05:04:58 +0000 Subject: [PATCH] - Made so every join is a SJOIN to prevent TS0 problems. Read config.h to disable this if it causes problems --- Changes | 1 + include/config.h | 5 +++++ src/channel.c | 47 +++++++++++++++++++++++------------------------ 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Changes b/Changes index c053fe775..739a3f6f7 100644 --- a/Changes +++ b/Changes @@ -1551,3 +1551,4 @@ seen. gmtime warning still there - Make makecert.bat and encpem.bat show their use in titlebar when run - Added define TOPIC_NICK_IS_NUHOST - nick!user@host in topic-whoset, undeffed by default, read warning in config.h. Only use with 3.2-beta12 or higher +- Made so every join is a SJOIN to prevent TS0 problems. Read config.h to disable this if it causes problems diff --git a/include/config.h b/include/config.h index 4a81ec345..c158d29e6 100644 --- a/include/config.h +++ b/include/config.h @@ -190,6 +190,11 @@ */ #undef TOPIC_NICK_IS_NUHOST +/* + * Use JOIN instead of SJOIN on every remotely sent JOIN +*/ +#undef JOIN_INSTEAD_OF_SJOIN_ON_REMOTEJOIN + /* ** Freelinks garbage collector -Stskeeps ** diff --git a/src/channel.c b/src/channel.c index ba6ed0972..211722811 100644 --- a/src/channel.c +++ b/src/channel.c @@ -3087,29 +3087,30 @@ CMD_FUNC(m_join) sendto_serv_butone_token_opt(cptr, OPT_NOT_SJ3, parv[0], MSG_JOIN, TOK_JOIN, "%s", chptr->chname); +#ifdef JOIN_INSTEAD_OF_SJOIN_ON_REMOTEJOIN if ((MyClient(sptr) && !(flags & CHFL_CHANOP)) || !MyClient(sptr)) sendto_serv_butone_token_opt(cptr, OPT_SJ3, parv[0], MSG_JOIN, TOK_JOIN, "%s", chptr->chname); - + if (flags & CHFL_CHANOP) + { +#endif + /* I _know_ that the "@%s " look a bit wierd + with the space and all .. but its to get around + a SJOIN bug --stskeeps */ + sendto_serv_butone_token_opt(cptr, OPT_SJ3|OPT_SJB64, + me.name, MSG_SJOIN, TOK_SJOIN, + "%B %s :%s%s ", chptr->creationtime, + chptr->chname, flags & CHFL_CHANOP ? "@" : "", sptr->name); + sendto_serv_butone_token_opt(cptr, OPT_SJ3|OPT_NOT_SJB64, + me.name, MSG_SJOIN, TOK_SJOIN, + "%li %s :%s%s ", chptr->creationtime, + chptr->chname, flags & CHFL_CHANOP ? "@" : "", sptr->name); +#ifdef JOIN_INSTEAD_OF_SJOIN_ON_REMOTEJOIN + } +#endif if (MyClient(sptr)) { - - /* Send out SJOIN stuff */ - if (flags & CHFL_CHANOP) - { - /* I _know_ that the "@%s " look a bit wierd - with the space and all .. but its to get around - a SJOIN bug --stskeeps */ - sendto_serv_butone_token_opt(cptr, OPT_SJ3|OPT_SJB64, - me.name, MSG_SJOIN, TOK_SJOIN, - "%B %s :@%s ", chptr->creationtime, - chptr->chname, sptr->name); - sendto_serv_butone_token_opt(cptr, OPT_SJ3|OPT_NOT_SJB64, - me.name, MSG_SJOIN, TOK_SJOIN, - "%li %s :@%s ", chptr->creationtime, - chptr->chname, sptr->name); - } /* ** Make a (temporal) creationtime, if someone joins ** during a net.reconnect : between remote join and @@ -3695,15 +3696,15 @@ CMD_FUNC(m_topic) #else tnick = make_nick_user_host(sptr->name, sptr->user->username, IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost); - nicKLen = strlen(tnick); + nicKlen = strlen(tnick); #endif if (chptr->topic) MyFree(chptr->topic); if (topiClen > (TOPICLEN)) topiClen = TOPICLEN; - if (nicKLen > (NICKLEN+USERLEN+HOSTLEN+5)) - nicKLen = NICKLEN+USERLEN+HOSTLEN+5; + if (nicKlen > (NICKLEN+USERLEN+HOSTLEN+5)) + nicKlen = NICKLEN+USERLEN+HOSTLEN+5; chptr->topic = MyMalloc(topiClen + 1); strncpyzt(chptr->topic, topic, topiClen + 1); @@ -3711,13 +3712,11 @@ CMD_FUNC(m_topic) MyFree(chptr->topic_nick); chptr->topic_nick = MyMalloc(nicKlen + 1); - strncpyzt(chptr->topic_nick, #ifndef TOPIC_NICK_IS_NUHOST - sptr->name, + strncpyzt(chptr->topic_nick, sptr->name, nicKlen + 1); #else - tnick, + strncpyzt(chptr->topic_nick, tnick, nicKlen + 1); #endif - nicKlen + 1); if (ttime && IsServer(cptr)) chptr->topic_time = ttime; else