diff --git a/include/modes.h b/include/modes.h index f5a3f920e..156bb1464 100644 --- a/include/modes.h +++ b/include/modes.h @@ -242,11 +242,9 @@ template class CoreExport ChannelModeVirtual : public T { -private: - ChannelMode *basech; - protected: Anope::string base; + ChannelMode *basech; public: ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename); diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 557d544fd..c797513ef 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -803,7 +803,7 @@ namespace InspIRCdExtBan } }; - class EntryMatcher final + class EntryMatcher : public Base { public: @@ -814,7 +814,9 @@ namespace InspIRCdExtBan bool Matches(User *u, const Entry *e) override { - return Entry(e->GetMask(), this->name, false).Matches(u); + auto mask = e->GetMask(); + auto *cm = basech->Unwrap(mask); + return Entry(mask, cm->name, false).Matches(u); } }; @@ -914,17 +916,17 @@ namespace InspIRCdExtBan }; class UnidentifiedMatcher final - : public Base + : public EntryMatcher { public: UnidentifiedMatcher(const Anope::string &mname, const Anope::string &xname, char xchar) - : Base(mname, xname, xchar) + : EntryMatcher(mname, xname, xchar) { } bool Matches(User *u, const Entry *e) override { - return !u->Account() && Entry(e->GetMask(), this->base, false).Matches(u); + return !u->Account() && EntryMatcher::Matches(u, e); } }; diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp index 1c3030255..e2266cb2c 100644 --- a/modules/protocol/unrealircd.cpp +++ b/modules/protocol/unrealircd.cpp @@ -573,7 +573,9 @@ namespace UnrealExtBan bool Matches(User *u, const Entry *e) override { - return Entry(e->GetMask(), this->base, false).Matches(u); + auto mask = e->GetMask(); + auto *cm = basech->Unwrap(mask); + return Entry(mask, cm->name, false).Matches(u); } }; diff --git a/src/modes.cpp b/src/modes.cpp index 698844fe6..0004af0d3 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -796,6 +796,8 @@ Anope::string Entry::GetCleanMask() const bool Entry::Matches(User *u, bool full) const { + Log(LOG_DEBUG) << "Checking whether " << u->GetMask() << " matches " << this->GetMask(); + /* First check if this mode has defined any matches (usually for extbans). */ if (IRCD->IsExtbanValid(this->mask)) {