From f2e3fd5952b23209b084bde4f464e6643c8a00ff Mon Sep 17 00:00:00 2001 From: Matt Schatz Date: Tue, 8 Jan 2019 03:03:53 -0700 Subject: Improve X-line text consistency. - Change any "-Line", ":Line", or "*line" to "-line" throughout the X-line code, comments, and documentation. - Add periods to the end of some notices. - Correct a typo in the Q-line code comments. - Update the filter module documentation (shun addition). Co-authored-by: Robby --- src/modules/m_spanningtree/treesocket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 878b34ad7..6206448c1 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -259,7 +259,7 @@ class TreeSocket : public BufferedSocket */ void SendFJoins(Channel* c); - /** Send G, Q, Z and E lines */ + /** Send G-, Q-, Z- and E-lines */ void SendXLines(); /** Send all known information about a channel */ -- cgit v1.3.1-10-gc9f91 From 25b3686f43d2a0dcc40157d7119a80b783a07f8f Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 19 Jan 2019 12:55:31 +0000 Subject: Fix sending the entire VERSION output as a single parameter. Closes #1560. --- src/coremods/core_info/cmd_version.cpp | 8 ++++++-- src/modules/m_spanningtree/main.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/coremods/core_info/cmd_version.cpp b/src/coremods/core_info/cmd_version.cpp index 29d96169e..57f9b05cf 100644 --- a/src/coremods/core_info/cmd_version.cpp +++ b/src/coremods/core_info/cmd_version.cpp @@ -29,8 +29,12 @@ CommandVersion::CommandVersion(Module* parent) CmdResult CommandVersion::Handle(User* user, const Params& parameters) { - std::string version = ServerInstance->GetVersionString((user->IsOper())); - user->WriteNumeric(RPL_VERSION, version); + Numeric::Numeric numeric(RPL_VERSION); + irc::tokenstream tokens(ServerInstance->GetVersionString(user->IsOper())); + for (std::string token; tokens.GetTrailing(token); ) + numeric.push(token); + user->WriteNumeric(numeric); + LocalUser *lu = IS_LOCAL(user); if (lu != NULL) { diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 985762872..de1e8eb19 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -324,8 +324,12 @@ ModResult ModuleSpanningTree::HandleVersion(const CommandBase::Params& parameter // If it's empty it might be that the server is still syncing (full version hasn't arrived yet) // or the server is a 2.0 server and does not send a full version. bool showfull = ((user->IsOper()) && (!found->GetFullVersion().empty())); - const std::string& Version = (showfull ? found->GetFullVersion() : found->GetVersion()); - user->WriteNumeric(RPL_VERSION, Version); + + Numeric::Numeric numeric(RPL_VERSION); + irc::tokenstream tokens(showfull ? found->GetFullVersion() : found->GetVersion()); + for (std::string token; tokens.GetTrailing(token); ) + numeric.push(token); + user->WriteNumeric(numeric); } else { -- cgit v1.3.1-10-gc9f91 From 965c81baee0fb6f46aa788f45742d558f50c8b15 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 22 Jan 2019 11:59:44 +0000 Subject: Rename OnClientProtocolProcessTag to OnProcessTag. --- include/clientprotocol.h | 2 +- src/clientprotocol.cpp | 2 +- src/modules/m_spanningtree/treesocket2.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/include/clientprotocol.h b/include/clientprotocol.h index 10b70e80b..ec033e166 100644 --- a/include/clientprotocol.h +++ b/include/clientprotocol.h @@ -549,7 +549,7 @@ class ClientProtocol::MessageTagProvider : public Events::ModuleEventListener * MOD_RES_PASSTHRU to make no decision. If no hooks accept a tag, the tag is rejected. * The default implementation returns MOD_RES_PASSTHRU. */ - virtual ModResult OnClientProtocolProcessTag(User* user, const std::string& tagname, std::string& tagvalue) + virtual ModResult OnProcessTag(User* user, const std::string& tagname, std::string& tagvalue) { return MOD_RES_PASSTHRU; } diff --git a/src/clientprotocol.cpp b/src/clientprotocol.cpp index a732855a5..212d65d6b 100644 --- a/src/clientprotocol.cpp +++ b/src/clientprotocol.cpp @@ -35,7 +35,7 @@ bool ClientProtocol::Serializer::HandleTag(LocalUser* user, const std::string& t for (::Events::ModuleEventProvider::SubscriberList::const_iterator i = list.begin(); i != list.end(); ++i) { MessageTagProvider* const tagprov = static_cast(*i); - const ModResult res = tagprov->OnClientProtocolProcessTag(user, tagname, tagvalue); + const ModResult res = tagprov->OnProcessTag(user, tagname, tagvalue); if (res == MOD_RES_ALLOW) return tags.insert(std::make_pair(tagname, MessageTagData(tagprov, tagvalue))).second; else if (res == MOD_RES_DENY) diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index dc24802fb..45f8a380f 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -292,7 +292,7 @@ void TreeSocket::ProcessTag(User* source, const std::string& tag, ClientProtocol for (Events::ModuleEventProvider::SubscriberList::const_iterator i = list.begin(); i != list.end(); ++i) { ClientProtocol::MessageTagProvider* const tagprov = static_cast(*i); - const ModResult res = tagprov->OnClientProtocolProcessTag(source, tagkey, tagval); + const ModResult res = tagprov->OnProcessTag(source, tagkey, tagval); if (res == MOD_RES_ALLOW) tags.insert(std::make_pair(tagkey, ClientProtocol::MessageTagData(tagprov, tagval))); else if (res == MOD_RES_DENY) -- cgit v1.3.1-10-gc9f91 From 5394adf41ff609f7f97af529774fcb616fe072b2 Mon Sep 17 00:00:00 2001 From: linuxdaemon Date: Wed, 23 Jan 2019 02:40:25 -0600 Subject: Fix away broadcast logic (#1561) --- src/modules/m_spanningtree/away.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/away.cpp b/src/modules/m_spanningtree/away.cpp index 13972589b..62300580f 100644 --- a/src/modules/m_spanningtree/away.cpp +++ b/src/modules/m_spanningtree/away.cpp @@ -47,6 +47,6 @@ CmdResult CommandAway::HandleRemote(::RemoteUser* u, Params& params) CommandAway::Builder::Builder(User* user) : CmdBuilder(user, "AWAY") { - if (user->awaymsg.empty()) + if (!user->awaymsg.empty()) push_int(user->awaytime).push_last(user->awaymsg); } -- cgit v1.3.1-10-gc9f91 From 2f35b78fbaadb8d9a6c47ffc198bd97f91af3306 Mon Sep 17 00:00:00 2001 From: linuxdaemon Date: Thu, 24 Jan 2019 09:52:59 -0600 Subject: Add translation for casemapping between 2.0/3.0 (#1544) If the casemapping is set to ascii, advertise the m_ascii module to 2.0 to allow use of the m_ascii extras module for 2.0--- src/modules/m_spanningtree/capab.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index c29330516..ea11a917e 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -76,6 +76,15 @@ std::string TreeSocket::MyModules(int filter) capabilities.append(v.link_data); } } + + // If we are linked in a 2.0 server and have an ascii casemapping + // advertise it as m_ascii.so from inspircd-extras + if ((filter & VF_COMMON) && ServerInstance->Config->CaseMapping == "ascii" && proto_version == 1202) + { + if (!capabilities.empty()) + capabilities += "m_ascii.so"; + } + return capabilities; } -- cgit v1.3.1-10-gc9f91