* @param status The minimum status rank to send this message to.
*/
void WriteNotice(const std::string& text, char status = 0);
+ void WriteRemoteNotice(const std::string& text, char status = 0);
};
inline bool Channel::HasUser(User* user)
{
ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, this, text, MSG_NOTICE, status);
Write(ServerInstance->GetRFCEvents().privmsg, privmsg);
+}
+
+void Channel::WriteRemoteNotice(const std::string& text, char status)
+{
+ WriteNotice(text, status);
ServerInstance->PI->SendMessage(this, status, text, MSG_NOTICE);
}
}
if (sendnotice)
- c->WriteNotice(InspIRCd::Format("User %s is KNOCKing on %s (%s)", user->nick.c_str(), c->name.c_str(), parameters[1].c_str()));
+ c->WriteRemoteNotice(InspIRCd::Format("User %s is KNOCKing on %s (%s)", user->nick.c_str(), c->name.c_str(), parameters[1].c_str()));
if (sendnumeric)
{
ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used OJOIN to join "+channel->name);
if (notice)
- channel->WriteNotice(user->nick + " joined on official network business.");
+ channel->WriteRemoteNotice(user->nick + " joined on official network business.");
}
else
{
}
if (NoisyOverride)
- chan->WriteNotice(InspIRCd::Format("%s used oper override to bypass %s", user->nick.c_str(), bypasswhat));
+ chan->WriteRemoteNotice(InspIRCd::Format("%s used oper override to bypass %s", user->nick.c_str(), bypasswhat));
ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass " + mode + " on " + chan->name);
return MOD_RES_ALLOW;
}
/* Build up the part reason string. */
reason = "Removed by " + user->nick + ": " + reasonparam;
- channel->WriteNotice(InspIRCd::Format("%s removed %s from the channel", user->nick.c_str(), target->nick.c_str()));
+ channel->WriteRemoteNotice(InspIRCd::Format("%s removed %s from the channel", user->nick.c_str(), target->nick.c_str()));
target->WriteNotice("*** " + user->nick + " removed you from " + channel->name + " with the message: " + reasonparam);
channel->PartUser(target, reason);
{
if (Utils->AnnounceTSChange)
{
- // WriteNotice is not used here because the message only needs to go to the local server.
- const std::string tsmessage = InspIRCd::Format("Creation time of %s changed from %s to %s", newname.c_str(),
- InspIRCd::TimeString(chan->age).c_str(), InspIRCd::TimeString(TS).c_str());
- ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, chan, tsmessage, MSG_NOTICE);
- chan->Write(ServerInstance->GetRFCEvents().privmsg, privmsg);
+ // WriteRemoteNotice is not used here because the message only needs to go to the local server.
+ chan->WriteNotice(InspIRCd::Format("Creation time of %s changed from %s to %s", newname.c_str(),
+ InspIRCd::TimeString(chan->age).c_str(), InspIRCd::TimeString(TS).c_str()));
}
// While the name is equal in case-insensitive compare, it might differ in case; use the remote version
PrefixMode* mh = ServerInstance->Modes->FindPrefixMode('h');
char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
- channel->WriteNotice(message, pfxchar);
+ channel->WriteRemoteNotice(message, pfxchar);
return CMD_SUCCESS;
}
PrefixMode* mh = ServerInstance->Modes->FindPrefixMode('h');
char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@';
- cr->WriteNotice(message, pfxchar);
+ cr->WriteRemoteNotice(message, pfxchar);
Modes::ChangeList setban;
setban.push_remove(ServerInstance->Modes->FindMode('b', MODETYPE_CHANNEL), mask);
user->WriteRemoteNumeric(n);
lu->WriteNumeric(RPL_UNINVITED, InspIRCd::Format("You were uninvited from %s by %s", c->name.c_str(), user->nick.c_str()));
- c->WriteNotice(InspIRCd::Format("*** %s uninvited %s.", user->nick.c_str(), u->nick.c_str()));
+ c->WriteRemoteNotice(InspIRCd::Format("*** %s uninvited %s.", user->nick.c_str(), u->nick.c_str()));
}
return CMD_SUCCESS;