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

Rename some fields to be more accurately named.

This commit is contained in:
Sadie Powell
2025-07-07 10:20:09 +01:00
parent 80c0adf7c8
commit 97389cd105
13 changed files with 76 additions and 68 deletions
+4 -4
View File
@@ -49,10 +49,10 @@ public:
Anope::string nick;
Anope::string last_quit;
Anope::string last_realname;
/* Last usermask this nick was seen on, eg user@host */
Anope::string last_usermask;
/* Last uncloaked usermask, requires nickserv/auspex to see */
Anope::string last_realhost;
/* Last cloaked user@host this nick was seen using. */
Anope::string last_userhost;
/* Last real user@host this nick was seen using. */
Anope::string last_userhost_real;
time_t registered = Anope::CurTime;
time_t last_seen = Anope::CurTime;
+1 -1
View File
@@ -253,7 +253,7 @@ public:
*/
bool HasPriv(const Anope::string &privstr);
/** Update the last usermask stored for a user. */
/** Update the last mask stored for a user. */
void UpdateHost();
/** Update the away state for a user. */
+11 -11
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Anope\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-02 14:07+0100\n"
"PO-Revision-Date: 2025-07-02 14:07+0100\n"
"POT-Creation-Date: 2025-07-07 11:46+0100\n"
"PO-Revision-Date: 2025-07-07 11:46+0100\n"
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
"Language-Team: English\n"
"Language: en_US\n"
@@ -597,7 +597,7 @@ msgstr ""
msgid "nickname [+expiry] [reason]"
msgstr ""
msgid "nickname {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"
msgid "nickname {EMAIL | STATUS | MASK | QUIT} {ON | OFF}"
msgstr ""
msgid "nickname {ON | delay | OFF}"
@@ -1520,7 +1520,7 @@ msgstr ""
msgid ""
"Allows Services Operators to manipulate the AKILL list. If a user matching an AKILL mask attempts to connect, services will issue a KILL for that user and, on supported server types, will instruct all servers to add a ban for the mask which the user matched.\n"
"\n"
"%sADD adds the given mask to the AKILL list for the given reason, which must be given. Mask should be in the format of nick!user@host#realname, though all that is required is user@host. If a real name is specified, the reason must be prepended with a :. expiry is specified as an integer followed by one of d (days), h (hours), or m (minutes). Combinations (such as 1h30m) are not permitted. If a unit specifier is not included, the default is days (so +30 by itself means 30 days). To add an AKILL which does not expire, use +0. If the usermask to be added starts with a +, an expiry time must be given, even if it is the same as the default. The current AKILL default expiry time can be found with the STATSAKILL command."
"%sADD adds the given mask to the AKILL list for the given reason, which must be given. Mask should be in the format of nick!user@host#realname, though all that is required is user@host. If a real name is specified, the reason must be prepended with a :. expiry is specified as an integer followed by one of d (days), h (hours), or m (minutes). Combinations (such as 1h30m) are not permitted. If a unit specifier is not included, the default is days (so +30 by itself means 30 days). To add an AKILL which does not expire, use +0. If the mask to be added starts with a +, an expiry time must be given, even if it is the same as the default. The current AKILL default expiry time can be found with the STATSAKILL command."
msgstr ""
msgid ""
@@ -1631,11 +1631,11 @@ msgid "Allows you to kill a user from the network. Parameters are the same as fo
msgstr ""
#, c-format
msgid "Allows you to prevent certain pieces of information from being displayed when someone does a %sINFO on the nick. You can hide the email address (EMAIL), last seen user@host mask (USERMASK), the services access status (STATUS) and last quit message (QUIT). The second parameter specifies whether the information should be displayed (OFF) or hidden (ON)."
msgid "Allows you to prevent certain pieces of information from being displayed when someone does a %sINFO on the nick. You can hide the email address (EMAIL), last seen user@host mask (MASK), the services access status (STATUS) and last quit message (QUIT). The second parameter specifies whether the information should be displayed (OFF) or hidden (ON)."
msgstr ""
#, c-format
msgid "Allows you to prevent certain pieces of information from being displayed when someone does a %sINFO on your nick. You can hide your email address(EMAIL), last seen user@host mask (USERMASK), your services access status (STATUS) and last quit message (QUIT). The second parameter specifies whether the information should be displayed (OFF) or hidden (ON)."
msgid "Allows you to prevent certain pieces of information from being displayed when someone does a %sINFO on your nick. You can hide your email address(EMAIL), last seen user@host mask (MASK), your services access status (STATUS) and last quit message (QUIT). The second parameter specifies whether the information should be displayed (OFF) or hidden (ON)."
msgstr ""
#, c-format
@@ -3133,6 +3133,9 @@ msgstr ""
msgid "Language for %s changed to %s."
msgstr ""
msgid "Last mask"
msgstr ""
#, c-format
msgid "Last memo to %s has been cancelled."
msgstr ""
@@ -3143,7 +3146,7 @@ msgstr ""
msgid "Last seen"
msgstr ""
msgid "Last seen address"
msgid "Last seen mask"
msgstr ""
msgid "Last topic"
@@ -3152,9 +3155,6 @@ msgstr ""
msgid "Last used"
msgstr ""
msgid "Last usermask"
msgstr ""
msgid "Level"
msgstr ""
@@ -3390,7 +3390,7 @@ msgstr ""
msgid ""
"Maintains the AutoKick list for a channel. If a user on the AutoKick list attempts to join the channel, %s will ban that user from the channel, then kick the user.\n"
"\n"
"The %sADD command adds the given nick or usermask to the AutoKick list. If a reason is given with the command, that reason will be used when the user is kicked; if not, the default reason is \"User has been banned from the channel\". When akicking a registered nick the %s account will be added to the akick list instead of the mask. All users within that nickgroup will then be akicked. \n"
"The %sADD command adds the given nick or mask to the AutoKick list. If a reason is given with the command, that reason will be used when the user is kicked; if not, the default reason is \"User has been banned from the channel\". When akicking a registered nick the %s account will be added to the akick list instead of the mask. All users within that nickgroup will then be akicked. \n"
"\n"
"The %sDEL command removes the given nick or mask from the AutoKick list. It does not, however, remove any bans placed by an AutoKick; those must be removed manually.\n"
"\n"
+3 -3
View File
@@ -141,7 +141,7 @@ class CommandCSAKick final
}
}
/* Match against the lastusermask of all nickalias's with equal
/* Match against the last mask of all nickalias's with equal
* or higher access. - Viper */
for (const auto &[_, na2] : *NickAliasList)
{
@@ -150,7 +150,7 @@ class CommandCSAKick final
AccessGroup nc_access = ci->AccessFor(na->nc), u_access = source.AccessFor(ci);
if (na->nc && (na->nc == ci->GetFounder() || nc_access >= u_access))
{
Anope::string buf = na->nick + "!" + na->last_usermask;
Anope::string buf = na->nick + "!" + na->last_userhost;
if (Anope::Match(buf, mask))
{
source.Reply(ACCESS_DENIED);
@@ -506,7 +506,7 @@ public:
"%s will ban that user from the channel, then kick "
"the user."
"\n\n"
"The \002%s\032ADD\002 command adds the given nick or usermask "
"The \002%s\032ADD\002 command adds the given nick or mask "
"to the AutoKick list. If a \037reason\037 is given with "
"the command, that reason will be used when the user is "
"kicked; if not, the default reason is \"User has been "
+8 -8
View File
@@ -134,9 +134,9 @@ struct UserData final
Anope::string info_adder;
Anope::string info_message;
time_t info_ts = 0;
Anope::string last_mask;
Anope::string last_quit;
Anope::string last_real_mask;
Anope::string last_userhost;
Anope::string last_userhost_real;
bool noexpire = false;
bool protect = false;
std::optional<time_t> protectafter;
@@ -1146,9 +1146,9 @@ private:
else if (key == "private:freeze:timestamp")
data->suspend_ts = Anope::Convert<time_t>(value, 0);
else if (key == "private:host:actual")
data->last_real_mask = value;
data->last_userhost_real = value;
else if (key == "private:host:vhost")
data->last_mask = value;
data->last_userhost = value;
else if (key == "private:lastquit:message")
data->last_quit = value;
else if (key == "private:loginfail:failnum")
@@ -1314,14 +1314,14 @@ private:
auto *data = userdata.Get(nc);
if (data)
{
if (!data->last_mask.empty())
na->last_usermask = data->last_mask;
if (!data->last_userhost.empty())
na->last_userhost = data->last_userhost;
if (!data->last_quit.empty())
na->last_quit = data->last_quit;
if (!data->last_real_mask.empty())
na->last_realhost = data->last_real_mask;
if (!data->last_userhost_real.empty())
na->last_userhost_real = data->last_userhost_real;
if (data->noexpire)
na->Extend<bool>("NS_NO_EXPIRE");
+4 -4
View File
@@ -616,11 +616,11 @@ static void LoadNicks()
for (int i = 0; i < 1024; ++i)
for (int c; (c = getc_db(f)) == 1;)
{
Anope::string nick, last_usermask, last_realname, last_quit;
Anope::string nick, last_userhost, last_realname, last_quit;
time_t registered, last_seen;
READ(read_string(nick, f));
READ(read_string(last_usermask, f));
READ(read_string(last_userhost, f));
READ(read_string(last_realname, f));
READ(read_string(last_quit, f));
@@ -658,7 +658,7 @@ static void LoadNicks()
ForbidData *d = forbid->CreateForbid();
d->mask = nc->display;
d->creator = last_usermask;
d->creator = last_userhost;
d->reason = last_realname;
d->expires = 0;
d->created = 0;
@@ -669,7 +669,7 @@ static void LoadNicks()
}
auto *na = new NickAlias(nick, nc);
na->last_usermask = last_usermask;
na->last_userhost = last_userhost;
na->last_realname = last_realname;
na->last_quit = last_quit;
na->registered = registered;
+1 -1
View File
@@ -55,7 +55,7 @@ public:
if (u != NULL)
{
na->last_usermask = u->GetIdent() + "@" + u->GetDisplayedHost();
na->last_userhost = u->GetIdent() + "@" + u->GetDisplayedHost();
na->last_realname = u->realname;
}
else
+23 -18
View File
@@ -93,13 +93,13 @@ public:
if (nick_online)
{
bool shown = false;
if (show_hidden && !na->last_realhost.empty())
if (show_hidden && !na->last_userhost_real.empty())
{
info[_("Online from")] = na->last_realhost;
info[_("Online from")] = na->last_userhost_real;
shown = true;
}
if ((show_hidden || !na->nc->HasExt("HIDE_MASK")) && (!shown || na->last_usermask != na->last_realhost))
info[_("Online from")] = na->last_usermask;
if ((show_hidden || !na->nc->HasExt("HIDE_MASK")) && (!shown || na->last_userhost != na->last_userhost_real))
info[_("Online from")] = na->last_userhost;
else
source.Reply(_("%s is currently online."), na->nick.c_str());
}
@@ -108,12 +108,12 @@ public:
Anope::string shown;
if (show_hidden || !na->nc->HasExt("HIDE_MASK"))
{
info[_("Last seen address")] = na->last_usermask;
shown = na->last_usermask;
info[_("Last seen mask")] = na->last_userhost;
shown = na->last_userhost;
}
if (show_hidden && !na->last_realhost.empty() && na->last_realhost != shown)
info[_("Last seen address")] = na->last_realhost;
if (show_hidden && !na->last_userhost_real.empty() && na->last_userhost_real != shown)
info[_("Last seen mask")] = na->last_userhost_real;
}
info[_("Account registered")] = Anope::strftime(na->nc->registered, source.GetAccount());
@@ -167,7 +167,7 @@ public:
CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2) : Command(creator, sname, min, min + 1)
{
this->SetDesc(_("Hide certain pieces of nickname information"));
this->SetSyntax("{EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}");
this->SetSyntax("{EMAIL | STATUS | MASK | QUIT} {ON | OFF}");
}
void Run(CommandSource &source, const Anope::string &user, const Anope::string &param, const Anope::string &arg)
@@ -199,7 +199,7 @@ public:
onmsg = _("The email address of \002%s\002 will now be hidden from %s INFO displays.");
offmsg = _("The email address of \002%s\002 will now be shown in %s INFO displays.");
}
else if (param.equals_ci("USERMASK"))
else if (param.equals_ci("MASK"))
{
flag = "HIDE_MASK";
onmsg = _("The last seen user@host mask of \002%s\002 will now be hidden from %s INFO displays.");
@@ -252,7 +252,7 @@ public:
"Allows you to prevent certain pieces of information from "
"being displayed when someone does a %s\032\002INFO\002 on your "
"nick. You can hide your email address\032(\002EMAIL\002), last seen "
"user@host mask (\002USERMASK\002), your services access status "
"user@host mask (\002MASK\002), your services access status "
"(\002STATUS\002) and last quit message (\002QUIT\002). "
"The second parameter specifies whether the information should "
"be displayed (\002OFF\002) or hidden (\002ON\002)."
@@ -268,7 +268,7 @@ class CommandNSSASetHide final
public:
CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3)
{
this->SetSyntax(_("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"));
this->SetSyntax(_("\037nickname\037 {EMAIL | STATUS | MASK | QUIT} {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -285,7 +285,7 @@ public:
"Allows you to prevent certain pieces of information from "
"being displayed when someone does a %s\032\002INFO\002 on the "
"nick. You can hide the email address (\002EMAIL\002), last seen "
"user@host mask (\002USERMASK\002), the services access status "
"user@host mask (\002MASK\002), the services access status "
"(\002STATUS\002) and last quit message (\002QUIT\002). "
"The second parameter specifies whether the information should "
"be displayed (\002OFF\002) or hidden (\002ON\002)."
@@ -303,13 +303,18 @@ class NSInfo final
CommandNSSetHide commandnssethide;
CommandNSSASetHide commandnssasethide;
SerializableExtensibleItem<bool> hide_email, hide_usermask, hide_status, hide_quit;
SerializableExtensibleItem<bool> hide_email, hide_mask, hide_status, hide_quit;
public:
NSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandnsinfo(this), commandnssethide(this), commandnssasethide(this),
hide_email(this, "HIDE_EMAIL"), hide_usermask(this, "HIDE_MASK"), hide_status(this, "HIDE_STATUS"),
hide_quit(this, "HIDE_QUIT")
NSInfo(const Anope::string &modname, const Anope::string &creator)
: Module(modname, creator, VENDOR)
, commandnsinfo(this)
, commandnssethide(this)
, commandnssasethide(this)
, hide_email(this, "HIDE_EMAIL")
, hide_mask(this, "HIDE_MASK")
, hide_status(this, "HIDE_STATUS")
, hide_quit(this, "HIDE_QUIT")
{
}
+6 -6
View File
@@ -73,7 +73,7 @@ public:
mync = source.nc;
ListFormatter list(source.GetAccount());
list.AddColumn(_("Nick")).AddColumn(_("Last usermask"));
list.AddColumn(_("Nick")).AddColumn(_("Last mask"));
Anope::map<NickAlias *> ordered_map;
for (const auto &[nick, na] : *NickAliasList)
@@ -94,7 +94,7 @@ public:
/* We no longer compare the pattern against the output buffer.
* Instead we build a nice nick!user@host buffer to compare.
* The output is then generated separately. -TheShadow */
Anope::string buf = Anope::printf("%s!%s", na->nick.c_str(), !na->last_usermask.empty() ? na->last_usermask.c_str() : "*@*");
Anope::string buf = Anope::printf("%s!%s", na->nick.c_str(), !na->last_userhost.empty() ? na->last_userhost.c_str() : "*@*");
if (na->nick.equals_ci(pattern) || Anope::Match(buf, pattern, false, true))
{
if (((count + 1 >= from && count + 1 <= to) || (!from && !to)) && ++nnicks <= listmax)
@@ -106,13 +106,13 @@ public:
ListFormatter::ListEntry entry;
entry["Nick"] = (isnoexpire ? "!" : "") + na->nick;
if (na->nc->HasExt("HIDE_MASK") && !is_servadmin && na->nc != mync)
entry["Last usermask"] = Language::Translate(source.GetAccount(), _("[Hostname hidden]"));
entry["Last mask"] = Language::Translate(source.GetAccount(), _("[Hostname hidden]"));
else if (na->nc->HasExt("NS_SUSPENDED"))
entry["Last usermask"] = Language::Translate(source.GetAccount(), _("[Suspended]"));
entry["Last mask"] = Language::Translate(source.GetAccount(), _("[Suspended]"));
else if (na->nc->HasExt("UNCONFIRMED"))
entry["Last usermask"] = Language::Translate(source.GetAccount(), _("[Unconfirmed]"));
entry["Last mask"] = Language::Translate(source.GetAccount(), _("[Unconfirmed]"));
else
entry["Last usermask"] = na->last_usermask;
entry["Last mask"] = na->last_userhost;
list.AddEntry(entry);
}
++count;
+1 -1
View File
@@ -141,7 +141,7 @@ public:
if (u)
{
na->last_usermask = u->GetIdent() + "@" + u->GetDisplayedHost();
na->last_userhost = u->GetIdent() + "@" + u->GetDisplayedHost();
na->last_realname = u->realname;
}
else
+1 -1
View File
@@ -450,7 +450,7 @@ public:
"\0371h30m\037) are not permitted. If a unit specifier is not "
"included, the default is days (so \037+30\037 by itself means 30 "
"days). To add an AKILL which does not expire, use \037+0\037. If the "
"usermask to be added starts with a \037+\037, an expiry time must "
"mask to be added starts with a \037+\037, an expiry time must "
"be given, even if it is the same as the default. The "
"current AKILL default expiry time can be found with the "
"\002STATS\032AKILL\002 command."
+9 -4
View File
@@ -156,8 +156,8 @@ void NickAlias::Type::Serialize(Serializable *obj, Serialize::Data &data) const
data.Store("nick", na->nick);
data.Store("last_quit", na->last_quit);
data.Store("last_realname", na->last_realname);
data.Store("last_usermask", na->last_usermask);
data.Store("last_realhost", na->last_realhost);
data.Store("last_userhost", na->last_userhost);
data.Store("last_userhost_real", na->last_userhost_real);
data.Store("registered", na->registered);
data.Store("last_seen", na->last_seen);
data.Store("ncid", na->nc->GetId());
@@ -209,8 +209,8 @@ Serializable *NickAlias::Type::Unserialize(Serializable *obj, Serialize::Data &d
data["last_quit"] >> na->last_quit;
data["last_realname"] >> na->last_realname;
data["last_usermask"] >> na->last_usermask;
data["last_realhost"] >> na->last_realhost;
data["last_userhost"] >> na->last_userhost;
data["last_userhost_real"] >> na->last_userhost_real;
data["registered"] >> na->registered;
data["last_seen"] >> na->last_seen;
@@ -235,6 +235,11 @@ Serializable *NickAlias::Type::Unserialize(Serializable *obj, Serialize::Data &d
// End 1.9 compatibility.
// Begin 2.0 compatibility.
if (na->last_userhost.empty())
data["last_usermask"] >> na->last_userhost;
if (na->last_userhost_real.empty())
data["last_realhost"] >> na->last_userhost_real;
if (!na->registered)
data["time_registered"] >> na->registered;
if (na->registered < na->nc->registered)
+4 -6
View File
@@ -376,8 +376,8 @@ void User::Identify(NickAlias *na)
{
if (this->nick.equals_ci(na->nick))
{
na->last_usermask = this->GetIdent() + "@" + this->GetDisplayedHost();
na->last_realhost = this->GetIdent() + "@" + this->host;
na->last_userhost = this->GetIdent() + "@" + this->GetDisplayedHost();
na->last_userhost_real = this->GetIdent() + "@" + this->host;
na->last_realname = this->realname;
na->last_seen = Anope::CurTime;
}
@@ -534,10 +534,8 @@ void User::UpdateHost()
NickAlias *na = NickAlias::Find(this->nick);
if (na && this->IsIdentified(true))
{
Anope::string last_usermask = this->GetIdent() + "@" + this->GetDisplayedHost();
Anope::string last_realhost = this->GetIdent() + "@" + this->host;
na->last_usermask = last_usermask;
na->last_realhost = last_realhost;
na->last_userhost = this->GetIdent() + "@" + this->GetDisplayedHost();
na->last_userhost_real = this->GetIdent() + "@" + this->host;
// This is called on signon, and if users are introduced with an account it won't update
na->last_realname = this->realname;
}