summaryrefslogtreecommitdiff
path: root/include/u_listmode.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-06 22:28:57 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-06 22:28:57 +0000
commit526f5a4a02882b19056fe755dff1f64b764ff313 (patch)
tree6a9e92e4f3f7088b18dcdde360d07c911ee174df /include/u_listmode.h
parenteacd707421be4f2612df9bde4517649061bb062e (diff)
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
Diffstat (limited to 'include/u_listmode.h')
-rw-r--r--include/u_listmode.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/u_listmode.h b/include/u_listmode.h
index b08ad8d4d..88b5fb3ee 100644
--- a/include/u_listmode.h
+++ b/include/u_listmode.h
@@ -423,18 +423,21 @@ class ListModeBase : public ModeHandler
chan->GetExt(infokey, mlist);
irc::modestacker modestack(ServerInstance, true);
std::deque<std::string> stackresult;
+ std::vector<TranslateType> types;
+ types.push_back(TR_TEXT);
if (mlist)
{
for (modelist::iterator it = mlist->begin(); it != mlist->end(); it++)
{
modestack.Push(std::string(1, mode)[0], it->mask);
+ types.push_back(this->GetTranslateType());
}
}
while (modestack.GetStackedLine(stackresult))
{
irc::stringjoiner mode_join(" ", stackresult, 0, stackresult.size() - 1);
std::string line = mode_join.GetJoined();
- proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, line);
+ proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, line, types);
}
}