diff options
| author | 2022-04-26 17:05:12 +0100 | |
|---|---|---|
| committer | 2022-04-26 17:09:31 +0100 | |
| commit | 4f58176bc2383aa48314f5f6da07b8cc57012d21 (patch) | |
| tree | c65653b27a1c44d6c3e4c461a5657178b11193d4 /src | |
| parent | Only write to the pid file on boot. (diff) | |
| parent | Implement support for the IRCv3 bot tag. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/extra/m_geo_maxmind.cpp | 2 | ||||
| -rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_botmode.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_knock.cpp | 32 |
4 files changed, 34 insertions, 6 deletions
diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp index c27f78221..66c63bd08 100644 --- a/src/modules/extra/m_geo_maxmind.cpp +++ b/src/modules/extra/m_geo_maxmind.cpp @@ -28,7 +28,7 @@ /// $PackageInfo: require_system("ubuntu" "16.04") libmaxminddb-dev pkg-config #ifdef _WIN32 -# pragma comment(lib, "libmaxminddb.lib") +# pragma comment(lib, "maxminddb.lib") #endif #include "inspircd.h" diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 8636f9596..1ed8490fa 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -48,8 +48,8 @@ #include <openssl/dh.h> #ifdef _WIN32 -# pragma comment(lib, "ssleay32.lib") -# pragma comment(lib, "libeay32.lib") +# pragma comment(lib, "libcrypto.lib") +# pragma comment(lib, "libssl.lib") #endif #if OPENSSL_VERSION_NUMBER >= 0x30000000L diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 95100ae0f..476168300 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -48,7 +48,7 @@ public: { User* const user = msg.GetSourceUser(); if (user && user->IsModeSet(botmode)) - msg.AddTag("inspircd.org/bot", this, ""); + msg.AddTag("bot", this, ""); } bool ShouldSendTag(LocalUser* user, const ClientProtocol::MessageTagData& tagdata) override diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 26d4e5a64..5b0f75817 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -26,6 +26,7 @@ #include "inspircd.h" +#include "modules/invite.h" enum { @@ -57,8 +58,10 @@ enum KnockNotify : uint8_t class CommandKnock final : public Command { +private: SimpleChannelMode& noknockmode; ChanModeReference inviteonlymode; + Invite::API inviteapi; public: int notify; @@ -67,6 +70,7 @@ public: : Command(Creator,"KNOCK", 2, 2) , noknockmode(Noknockmode) , inviteonlymode(Creator, "inviteonly") + , inviteapi(Creator) { syntax = { "<channel> :<reason>" }; Penalty = 5; @@ -99,9 +103,33 @@ public: return CmdResult::FAILURE; } + // Work out who we should send the knock to. + char status; + switch (inviteapi->GetAnnounceState()) + { + case Invite::ANNOUNCE_ALL: + { + status = 0; + break; + } + + case Invite::ANNOUNCE_DYNAMIC: + { + PrefixMode* mh = ServerInstance->Modes.FindNearestPrefixMode(HALFOP_VALUE); + status = mh->GetPrefix() ? mh->GetPrefix() : '@'; + break; + } + + default: + { + status = '@'; + break; + } + } + if (notify & KN_SEND_NOTICE) { - c->WriteNotice(InspIRCd::Format("User %s is KNOCKing on %s (%s)", user->nick.c_str(), c->name.c_str(), parameters[1].c_str())); + c->WriteNotice(InspIRCd::Format("User %s is KNOCKing on %s (%s)", user->nick.c_str(), c->name.c_str(), parameters[1].c_str()), status); user->WriteNotice("KNOCKing on " + c->name); } @@ -111,7 +139,7 @@ public: numeric.push(c->name).push(user->GetFullHost()).push("is KNOCKing: " + parameters[1]); ClientProtocol::Messages::Numeric numericmsg(numeric, c->name); - c->Write(ServerInstance->GetRFCEvents().numeric, numericmsg); + c->Write(ServerInstance->GetRFCEvents().numeric, numericmsg, status); user->WriteNumeric(RPL_KNOCKDLVR, c->name, "KNOCKing on channel"); } |
