diff options
| author | Sadie Powell <sadie@witchery.services> | 2024-03-04 10:36:10 +0000 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2024-03-04 11:09:50 +0000 |
| commit | 1a8ae513b43d6f5ab5f83740c73d018eafb44d9a (patch) | |
| tree | c5a8c9c1fc246cf7fa691da01afb941809afe1f4 /modules/hostserv | |
| parent | d15ac93a8f5fb5c939807807be52108f7d49f8ed (diff) | |
Add NickAlias::GetVhostMask for getting the vident@vhost.
Diffstat (limited to 'modules/hostserv')
| -rw-r--r-- | modules/hostserv/hostserv.cpp | 12 | ||||
| -rw-r--r-- | modules/hostserv/hs_group.cpp | 6 | ||||
| -rw-r--r-- | modules/hostserv/hs_list.cpp | 10 | ||||
| -rw-r--r-- | modules/hostserv/hs_on.cpp | 7 | ||||
| -rw-r--r-- | modules/hostserv/hs_set.cpp | 10 |
5 files changed, 12 insertions, 33 deletions
diff --git a/modules/hostserv/hostserv.cpp b/modules/hostserv/hostserv.cpp index 17c820377..bdd1920e1 100644 --- a/modules/hostserv/hostserv.cpp +++ b/modules/hostserv/hostserv.cpp @@ -59,10 +59,8 @@ public: if (HostServ) { - if (!na->GetVhostIdent().empty()) - u->SendMessage(HostServ, _("Your vhost of \002%s\002@\002%s\002 is now activated."), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str()); - else - u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."), na->GetVhostHost().c_str()); + u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."), + na->GetVhostMask().c_str()); } } } @@ -107,10 +105,8 @@ public: if (HostServ) { - if (!na->GetVhostIdent().empty()) - u->SendMessage(HostServ, _("Your vhost of \002%s\002@\002%s\002 is now activated."), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str()); - else - u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."), na->GetVhostHost().c_str()); + u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."), + na->GetVhostMask().c_str()); } } } diff --git a/modules/hostserv/hs_group.cpp b/modules/hostserv/hs_group.cpp index 9db0bbb00..2877fa16d 100644 --- a/modules/hostserv/hs_group.cpp +++ b/modules/hostserv/hs_group.cpp @@ -54,10 +54,8 @@ public: if (na && source.GetAccount() == na->nc && na->HasVhost()) { this->Sync(na); - if (!na->GetVhostIdent().empty()) - source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002@\002%s\002."), source.nc->display.c_str(), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str()); - else - source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002."), source.nc->display.c_str(), na->GetVhostHost().c_str()); + source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002."), + source.nc->display.c_str(), na->GetVhostMask().c_str()); } else source.Reply(HOST_NOT_ASSIGNED); diff --git a/modules/hostserv/hs_list.cpp b/modules/hostserv/hs_list.cpp index 8cda26c38..7b85bead3 100644 --- a/modules/hostserv/hs_list.cpp +++ b/modules/hostserv/hs_list.cpp @@ -72,10 +72,7 @@ public: ListFormatter::ListEntry entry; entry["Number"] = stringify(display_counter); entry["Nick"] = na->nick; - if (!na->GetVhostIdent().empty()) - entry["Vhost"] = na->GetVhostIdent() + "@" + na->GetVhostHost(); - else - entry["Vhost"] = na->GetVhostHost(); + entry["Vhost"] = na->GetVhostMask(); entry["Creator"] = na->GetVhostCreator(); entry["Created"] = Anope::strftime(na->GetVhostCreated(), NULL, true); list.AddEntry(entry); @@ -93,10 +90,7 @@ public: ListFormatter::ListEntry entry; entry["Number"] = stringify(display_counter); entry["Nick"] = na->nick; - if (!na->GetVhostIdent().empty()) - entry["Vhost"] = na->GetVhostIdent() + "@" + na->GetVhostHost(); - else - entry["Vhost"] = na->GetVhostHost(); + entry["Vhost"] = na->GetVhostMask(); entry["Creator"] = na->GetVhostCreator(); entry["Created"] = Anope::strftime(na->GetVhostCreated(), NULL, true); list.AddEntry(entry); diff --git a/modules/hostserv/hs_on.cpp b/modules/hostserv/hs_on.cpp index c8c01b7b2..e37b1278e 100644 --- a/modules/hostserv/hs_on.cpp +++ b/modules/hostserv/hs_on.cpp @@ -32,11 +32,8 @@ public: na = NickAlias::Find(u->Account()->display); if (na && u->Account() == na->nc && na->HasVhost()) { - if (!na->GetVhostIdent().empty()) - source.Reply(_("Your vhost of \002%s\002@\002%s\002 is now activated."), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str()); - else - source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVhostHost().c_str()); - Log(LOG_COMMAND, source, this) << "to enable their vhost of " << (!na->GetVhostIdent().empty() ? na->GetVhostIdent() + "@" : "") << na->GetVhostHost(); + source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVhostMask().c_str()); + Log(LOG_COMMAND, source, this) << "to enable their vhost of " << na->GetVhostMask(); IRCD->SendVhost(u, na->GetVhostIdent(), na->GetVhostHost()); u->vhost = na->GetVhostHost(); if (IRCD->CanSetVIdent && !na->GetVhostIdent().empty()) diff --git a/modules/hostserv/hs_set.cpp b/modules/hostserv/hs_set.cpp index 665e24467..261e1e51f 100644 --- a/modules/hostserv/hs_set.cpp +++ b/modules/hostserv/hs_set.cpp @@ -87,10 +87,7 @@ public: na->SetVhost(user, host, source.GetNick()); FOREACH_MOD(OnSetVhost, (na)); - if (!user.empty()) - source.Reply(_("VHost for \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), user.c_str(), host.c_str()); - else - source.Reply(_("VHost for \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str()); + source.Reply(_("VHost for \002%s\002 set to \002%s\002."), nick.c_str(), na->GetVhostMask().c_str()); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override @@ -194,10 +191,7 @@ public: na->SetVhost(user, host, source.GetNick()); this->Sync(na); FOREACH_MOD(OnSetVhost, (na)); - if (!user.empty()) - source.Reply(_("VHost for group \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), user.c_str(), host.c_str()); - else - source.Reply(_("VHost for group \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str()); + source.Reply(_("VHost for group \002%s\002 set to \002%s\002."), nick.c_str(), na->GetVhostMask().c_str()); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override |
