From 4ae42b33e653d58539a2d7b5821cd2d1d692132b Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 2 Oct 2006 09:24:49 +0000 Subject: Add more features to modestacker so that we can stack +, -, and parameterless modes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5391 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/hashcomp.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/hashcomp.cpp') diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 8a4febb60..4dd9050b4 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -321,6 +321,21 @@ void irc::modestacker::Push(char modeletter, const std::string ¶meter) sequence.push_back(parameter); } +void irc::modestacker::Push(char modeletter) +{ + this->Push(modeletter,""); +} + +void irc::modestacker::PushPlus() +{ + this->Push('+',""); +} + +void irc::modestacker::PushMinus() +{ + this->Push('-',""); +} + int irc::modestacker::GetStackedLine(std::deque &result) { result.clear(); @@ -329,7 +344,8 @@ int irc::modestacker::GetStackedLine(std::deque &result) while (!sequence[0].empty() && (sequence.size() > 1) && (result.size() < MAXMODES+1)) { result[0] += *(sequence[0].begin()); - result.push_back(sequence[1]); + if (!sequence[1].empty()) + result.push_back(sequence[1]); sequence[0].erase(sequence[0].begin()); sequence.erase(sequence.begin() + 1); } -- cgit v1.2.3