summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-10-22 14:14:40 +0100
committerSadie Powell <sadie@witchery.services>2024-10-22 14:27:30 +0100
commit435ce511962e83a0581accd572dfa4e2c5722ab4 (patch)
tree78147b7be694087752d15bd48dcb75b0a1493f9b /src
parent57ac7cb4db63dee8e06d696ef6f973c337467040 (diff)
Move nickserv/set/message to a new module, kill options:useprivmsg.
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp3
-rw-r--r--src/servers.cpp2
-rw-r--r--src/users.cpp8
3 files changed, 6 insertions, 7 deletions
diff --git a/src/config.cpp b/src/config.cpp
index ebf142c04..28be07318 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -121,7 +121,7 @@ template<typename T> static void ValidateNotZero(const Anope::string &block, con
Conf::Conf() : Block("")
{
ReadTimeout = 0;
- UsePrivmsg = DefPrivmsg = false;
+ DefPrivmsg = false;
this->LoadConf(ServicesConf);
@@ -195,7 +195,6 @@ Conf::Conf() : Block("")
}
this->ReadTimeout = options->Get<time_t>("readtimeout");
- this->UsePrivmsg = options->Get<bool>("useprivmsg");
this->UseStrictPrivmsg = options->Get<bool>("usestrictprivmsg");
this->StrictPrivmsg = !UseStrictPrivmsg ? "/msg " : "/";
{
diff --git a/src/servers.cpp b/src/servers.cpp
index ca418aec0..7d4e57770 100644
--- a/src/servers.cpp
+++ b/src/servers.cpp
@@ -328,7 +328,7 @@ bool Server::IsQuitting() const
void Server::Notice(BotInfo *source, const Anope::string &message)
{
- if (Config->UsePrivmsg && Config->DefPrivmsg)
+ if (Config->DefPrivmsg)
IRCD->SendGlobalPrivmsg(source, this, message);
else
IRCD->SendGlobalNotice(source, this, message);
diff --git a/src/users.cpp b/src/users.cpp
index e39114654..5f83420a4 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -839,10 +839,10 @@ bool User::BadPassword()
bool User::ShouldPrivmsg() const
{
// Send a PRIVMSG instead of a NOTICE if:
- // 1. options:useprivmsg is enabled.
- // 2. The user is not registered and msg is in nickserv:defaults.
- // 3. The user is registered and has set /ns set message on.
- return Config->UsePrivmsg && ((!nc && Config->DefPrivmsg) || (nc && nc->HasExt("MSG")));
+ // 1. The user is not registered and msg is in nickserv:defaults.
+ // 2. The user is registered and has set /ns set message on.
+ static ExtensibleRef<bool> msg("MSG");
+ return (!nc && Config->DefPrivmsg) || (nc && msg && msg->HasExt(nc));
}
User *User::Find(const Anope::string &name, bool nick_only)