summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-01-29 11:44:50 +0000
committerSadie Powell <sadie@witchery.services>2020-01-29 12:00:32 +0000
commit6597fe5d4fd2c1cc474fa35a0db21fec480ff47f (patch)
tree1ad5986e40cb8e7dc392af21cd5d0e5e119196c2 /src/modules
parent64df216836aa1027aa7d6b7242264a982dc540bc (diff)
Add Channel::WriteRemoteNotice and revert WriteNotice changes.
This is a partial reversion of 687778b72e. See also: #1749.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_knock.cpp2
-rw-r--r--src/modules/m_ojoin.cpp2
-rw-r--r--src/modules/m_override.cpp2
-rw-r--r--src/modules/m_remove.cpp2
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp8
-rw-r--r--src/modules/m_timedbans.cpp4
-rw-r--r--src/modules/m_uninvite.cpp2
7 files changed, 10 insertions, 12 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index afe12bf0d..e9e40c710 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -84,7 +84,7 @@ class CommandKnock : public Command
}
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)
{
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 0e924295c..467f8c5c6 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -60,7 +60,7 @@ class CommandOjoin : public SplitCommand
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
{
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index fff58b035..827e6dee8 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -76,7 +76,7 @@ class ModuleOverride : public Module
}
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;
}
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index 1061a964f..10209af78 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -141,7 +141,7 @@ class RemoveBase : public Command
/* 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);
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index 750c33d42..4ca09da5e 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -279,11 +279,9 @@ void CommandFJoin::LowerTS(Channel* chan, time_t TS, const std::string& newname)
{
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
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index cbdea1179..8b449f768 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -137,7 +137,7 @@ class CommandTban : public Command
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;
}
@@ -228,7 +228,7 @@ class ModuleTimedBans : public Module
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);
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index b74314fe8..566ba8806 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -104,7 +104,7 @@ class CommandUninvite : public Command
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;