1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Swap the mode and mask params to Entry and make the mode optional.

This commit is contained in:
Sadie Powell
2026-01-26 18:57:29 +00:00
parent a0676ef8b1
commit 48bb6089fa
9 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -441,11 +441,11 @@ public:
Anope::string nick, user, host, real;
/** Constructor
* @param mode What mode this host is for, can be empty for unknown/no mode
* @param mask A full or partial nick!ident@host/cidr#real name mask
* @param mode What mode this host is for, can be empty for unknown/no mode
* @Param real Whether to allow a real name in the mask.
*/
Entry(const Anope::string &mode, const Anope::string &mask, bool real = true);
Entry(const Anope::string &mask, const Anope::string &mode = "", bool real = true);
/** Get the banned mask for this entry
* @return The mask
+1 -1
View File
@@ -226,7 +226,7 @@ private:
else
{
// Normalize the entry mask.
mask = Entry("", mask).GetCleanMask();
mask = Entry(mask).GetCleanMask();
}
}
}
+1 -1
View File
@@ -796,7 +796,7 @@ public:
kick = chan != NULL && chan->FindUser(u);
}
else
kick = Entry("BAN", autokick->mask).Matches(u);
kick = Entry(autokick->mask, "BAN").Matches(u);
if (kick)
{
+1 -1
View File
@@ -153,7 +153,7 @@ class CommandCSFlags final
else
{
// Normalize the entry mask.
mask = Entry("", mask).GetCleanMask();
mask = Entry(mask).GetCleanMask();
}
}
}
+1 -1
View File
@@ -201,7 +201,7 @@ private:
else
{
// Normalize the entry mask.
mask = Entry("", mask).GetCleanMask();
mask = Entry(mask).GetCleanMask();
}
}
}
+2 -2
View File
@@ -788,7 +788,7 @@ namespace InspIRCdExtBan
bool Matches(User *u, const Entry *e) override
{
return Entry(this->name, e->GetMask(), false).Matches(u);
return Entry(e->GetMask(), this->name, false).Matches(u);
}
};
@@ -898,7 +898,7 @@ namespace InspIRCdExtBan
bool Matches(User *u, const Entry *e) override
{
return !u->Account() && Entry(this->base, e->GetMask(), false).Matches(u);
return !u->Account() && Entry(e->GetMask(), this->base, false).Matches(u);
}
};
+2 -2
View File
@@ -564,7 +564,7 @@ namespace UnrealExtBan
bool Matches(User *u, const Entry *e) override
{
return Entry(this->base, e->GetMask(), false).Matches(u);
return Entry(e->GetMask(), this->base, false).Matches(u);
}
};
@@ -646,7 +646,7 @@ namespace UnrealExtBan
/* strip down the time (~t:1234:) and call other matchers */
auto real_mask = e->GetMask();
real_mask = real_mask.substr(real_mask.find(":") + 1);
return Entry("BAN", real_mask, false).Matches(u);
return Entry(real_mask, "BAN", false).Matches(u);
}
};
+1 -1
View File
@@ -673,7 +673,7 @@ void ModeManager::StackerDel(Mode *m)
}
}
Entry::Entry(const Anope::string &n, const Anope::string &m, bool r)
Entry::Entry(const Anope::string &m, const Anope::string &n, bool r)
: name(n)
, mask(m)
{
+1 -1
View File
@@ -389,7 +389,7 @@ Anope::string IRCDProto::NormalizeMask(const Anope::string &mask)
{
if (IsExtbanValid(mask))
return mask;
return Entry("", mask).GetCleanMask();
return Entry(mask).GetCleanMask();
}
void IRCDProto::SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg, const Anope::map<Anope::string> &tags)