mirror of
https://github.com/anope/anope.git
synced 2026-06-12 15:44:46 +02:00
Fix matching stacked extended bans.
This commit is contained in:
+1
-3
@@ -242,11 +242,9 @@ template<typename T>
|
||||
class CoreExport ChannelModeVirtual
|
||||
: public T
|
||||
{
|
||||
private:
|
||||
ChannelMode *basech;
|
||||
|
||||
protected:
|
||||
Anope::string base;
|
||||
ChannelMode *basech;
|
||||
|
||||
public:
|
||||
ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user