A convenience function for ProtocolInterface::SendMode that just takes a string, then splits it internally to deque for sending to the other function of the same name

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9303 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2008-04-04 13:21:12 +00:00
parent 0d9e5bd011
commit d3d32dcf6d
3 changed files with 22 additions and 10 deletions

View File

@ -14,6 +14,8 @@
#ifndef __PROTOCOL_H__
#define __PROTOCOL_H__
#include "hashcomp.h"
class InspIRCd;
typedef std::deque<std::string> parameterlist;
@ -27,12 +29,30 @@ class ProtocolInterface : public Extensible
virtual ~ProtocolInterface() { }
virtual void SendEncapsulatedData(parameterlist &encap) { }
virtual void SendMetaData(void* target, int type, const std::string &key, const std::string &data) { }
virtual void SendTopic(Channel* channel, std::string &topic) { }
virtual void SendMode(const std::string &target, parameterlist &modedata) { }
virtual void SendMode(const std::string &target, const std::string &modeline)
{
/* Convenience function */
irc::spacesepstream x(modeline);
parameterlist n;
std::string v;
while (x.GetToken(v))
n.push_back(v);
SendMode(target, n);
}
virtual void SendOperNotice(const std::string &text) { }
virtual void SendModeNotice(const std::string &modes, const std::string &text) { }
virtual void SendSNONotice(const std::string &snomask, const std::string &text) { }
virtual void PushToClient(User* target, const std::string &rawline) { }
};

View File

@ -238,10 +238,7 @@ class ModuleMsgFlood : public Module
parameters[2] = user->MakeWildHost();
ServerInstance->SendMode(parameters,3,user);
parameterlist n;
n.push_back("+b");
n.push_back(user->MakeWildHost());
ServerInstance->PI->SendMode(dest->name, n);
ServerInstance->PI->SendMode(dest->name, std::string("+b ") + user->MakeWildhost());
}
char kickmessage[MAXBUF];
snprintf(kickmessage, MAXBUF, "Channel flood triggered (limit is %d lines in %d secs)", f->lines, f->secs);

View File

@ -162,12 +162,7 @@ class ModuleTimedBans : public Module
setban[1] = "-b";
setban[2] = i->mask.c_str();
/* Send mode remotely*/
std::deque<std::string> n;
n.push_back("-b");
n.push_back(setban[2]);
ServerInstance->PI->SendMode(i->channel, n);
ServerInstance->PI->SendMode(i->channel, std::string("-b ") + setban[2]);
ServerInstance->SendMode(setban,3, ServerInstance->FakeClient);
CUList empty;