From 526f5a4a02882b19056fe755dff1f64b764ff313 Mon Sep 17 00:00:00 2001 From: danieldg Date: Fri, 6 Mar 2009 22:28:57 +0000 Subject: Construct explicit parameter type list for MODE parameters Previously, we used TR_SPACENICKLIST on the parameters. This worked only because usually, if anything in the list parsed as a nick, then it was a nick. However, some modes like +k and +g allow free-form text, which could also resolve as a nick. Add extra parameters to allow modes to specify their TranslateType, defaulting to TR_TEXT. This fixes bug #757, found by Taros git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11180 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modules/m_spanningtree/main.cpp') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index da393858c..51a9eb025 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -800,7 +800,7 @@ void ModuleSpanningTree::OnDelLine(User* user, XLine *x) } } -void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const std::string &text) +void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const std::string &text, const std::vector &translate) { if ((IS_LOCAL(user)) && (user->registered == REG_ALL)) { @@ -808,7 +808,7 @@ void ModuleSpanningTree::OnMode(User* user, void* dest, int target_type, const s std::string command; std::string output_text; - ServerInstance->Parser->TranslateUIDs(TR_SPACENICKLIST, text, output_text); + ServerInstance->Parser->TranslateUIDs(translate, text, output_text); if (target_type == TYPE_USER) { @@ -851,19 +851,19 @@ int ModuleSpanningTree::OnSetAway(User* user, const std::string &awaymsg) return 0; } -void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::string &modeline) +void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::string &modeline, const std::vector &translate) { TreeSocket* s = (TreeSocket*)opaque; std::string output_text; - ServerInstance->Parser->TranslateUIDs(TR_SPACENICKLIST, modeline, output_text); + ServerInstance->Parser->TranslateUIDs(translate, modeline, output_text); if (target) { if (target_type == TYPE_USER) { User* u = (User*)target; - s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" FMODE "+u->uuid+" "+ConvToStr(u->age)+" "+output_text); + s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" MODE "+u->uuid+" "+output_text); } else if (target_type == TYPE_CHANNEL) { -- cgit v1.2.3