mirror of
https://github.com/anope/anope.git
synced 2026-06-25 05:36:37 +02:00
Make User::Mask behave more like 1.8
This commit is contained in:
+3
-4
@@ -347,10 +347,9 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
|
||||
/* Returns a mask that will most likely match any address the
|
||||
* user will have from that location. For IP addresses, wildcards the
|
||||
* appropriate subnet mask (e.g. 35.1.1.1 -> 35.*; 128.2.1.1 -> 128.2.*);
|
||||
* for named addresses, wildcards the leftmost part of the name unless the
|
||||
* name only contains two parts. If the username begins with a ~, delete
|
||||
* it.
|
||||
* last octet (e.g. 35.1.1.1 -> 35.1.1.*). for named addresses, wildcards
|
||||
* the leftmost part of the name unless the name only contains two parts.
|
||||
* If the username begins with a ~, replace with *.
|
||||
*/
|
||||
Anope::string Mask() const;
|
||||
|
||||
|
||||
+1
-1
@@ -781,7 +781,7 @@ Anope::string User::Mask() const
|
||||
sockaddrs addr(mhost);
|
||||
if (addr.valid() && addr.sa.sa_family == AF_INET)
|
||||
{
|
||||
size_t dot = mhost.find('.');
|
||||
size_t dot = mhost.rfind('.');
|
||||
mask += mhost.substr(0, dot) + (dot == Anope::string::npos ? "" : ".*");
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user