mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
The rest of the server protocol interface and fix a warning in m_rline
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9299 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
b29d14d000
commit
b07868e77c
@ -29,7 +29,7 @@ class ProtocolInterface : public Extensible
|
||||
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 &origin, const std::string &target, parameterlist &modedata) { }
|
||||
virtual void SendMode(const std::string &target, parameterlist &modedata) { }
|
||||
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) { }
|
||||
|
@ -224,12 +224,12 @@ class ModuleRLine : public Module
|
||||
virtual void OnUserConnect(User* user)
|
||||
{
|
||||
// Apply lines on user connect
|
||||
XLine *r = ServerInstance->XLines->MatchesLine("R", user);
|
||||
XLine *rl = ServerInstance->XLines->MatchesLine("R", user);
|
||||
|
||||
if (r)
|
||||
if (rl)
|
||||
{
|
||||
// Bang. :P
|
||||
r->Apply(user);
|
||||
rl->Apply(user);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -42,23 +42,64 @@ void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &top
|
||||
Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FTOPIC", params);
|
||||
}
|
||||
|
||||
void SpanningTreeProtocolInterface::SendMode(const std::string &origin, const std::string &target, parameterlist &modedata)
|
||||
void SpanningTreeProtocolInterface::SendMode(const std::string &target, parameterlist &modedata)
|
||||
{
|
||||
if (modedata.empty())
|
||||
return;
|
||||
|
||||
/* Warning: in-place translation is only safe for type TR_NICK */
|
||||
for (size_t n = 0; n < modedata.size(); n++)
|
||||
ServerInstance->Parser->TranslateUIDs(TR_NICK, modedata[n], modedata[n]);
|
||||
|
||||
std::string uidtarget;
|
||||
ServerInstance->Parser->TranslateUIDs(TR_NICK, target, uidtarget);
|
||||
modedata.insert(modedata.begin(), uidtarget);
|
||||
|
||||
User* a = ServerInstance->FindNick(uidtarget);
|
||||
if (a)
|
||||
{
|
||||
Utils->DoOneToMany(ServerInstance->Config->GetSID(),"MODE",modedata);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Channel* c = ServerInstance->FindChan(target);
|
||||
if (c)
|
||||
{
|
||||
modedata.insert(modedata.begin() + 1, ConvToStr(c->age));
|
||||
Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FMODE",modedata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpanningTreeProtocolInterface::SendOperNotice(const std::string &text)
|
||||
{
|
||||
parameterlist p;
|
||||
p.push_back(":" + text);
|
||||
Utils->DoOneToMany(ServerInstance->Config->GetSID(), "OPERNOTICE", p);
|
||||
}
|
||||
|
||||
void SpanningTreeProtocolInterface::SendModeNotice(const std::string &modes, const std::string &text)
|
||||
{
|
||||
parameterlist p;
|
||||
p.push_back(modes);
|
||||
p.push_back(":" + text);
|
||||
Utils->DoOneToMany(ServerInstance->Config->GetSID(), "MODENOTICE", p);
|
||||
}
|
||||
|
||||
void SpanningTreeProtocolInterface::SendSNONotice(const std::string &snomask, const std::string &text)
|
||||
{
|
||||
parameterlist p;
|
||||
p.push_back(snomask);
|
||||
p.push_back(":" + text);
|
||||
Utils->DoOneToMany(ServerInstance->Config->GetSID(), "SNONOTICE", p);
|
||||
}
|
||||
|
||||
void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string &rawline)
|
||||
{
|
||||
parameterlist p;
|
||||
p.push_back(target->uuid);
|
||||
p.push_back(rawline);
|
||||
Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PUSH", p, target->server);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class SpanningTreeProtocolInterface : public 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 &origin, const std::string &target, parameterlist &modedata);
|
||||
virtual void SendMode(const std::string &target, parameterlist &modedata);
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user