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 | |
| parent | d15ac93a8f5fb5c939807807be52108f7d49f8ed (diff) | |
Add NickAlias::GetVhostMask for getting the vident@vhost.
Diffstat (limited to 'modules')
| -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 | ||||
| -rw-r--r-- | modules/nickserv/ns_info.cpp | 7 | ||||
| -rw-r--r-- | modules/webcpanel/pages/hostserv/request.cpp | 7 | ||||
| -rw-r--r-- | modules/webcpanel/pages/nickserv/info.cpp | 7 |
8 files changed, 15 insertions, 51 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 diff --git a/modules/nickserv/ns_info.cpp b/modules/nickserv/ns_info.cpp index 33efbc24f..09769345c 100644 --- a/modules/nickserv/ns_info.cpp +++ b/modules/nickserv/ns_info.cpp @@ -102,12 +102,7 @@ public: if (show_hidden) { if (na->HasVhost()) - { - if (IRCD->CanSetVIdent && !na->GetVhostIdent().empty()) - info[_("VHost")] = na->GetVhostIdent() + "@" + na->GetVhostHost(); - else - info[_("VHost")] = na->GetVhostHost(); - } + info[_("VHost")] = na->GetVhostMask(); } FOREACH_MOD(OnNickInfo, (source, na, info, show_hidden)); diff --git a/modules/webcpanel/pages/hostserv/request.cpp b/modules/webcpanel/pages/hostserv/request.cpp index 373686600..0a8513c76 100644 --- a/modules/webcpanel/pages/hostserv/request.cpp +++ b/modules/webcpanel/pages/hostserv/request.cpp @@ -22,12 +22,7 @@ bool WebCPanel::HostServ::Request::OnRequest(HTTPProvider *server, const Anope:: } if (na->HasVhost()) - { - if (!na->GetVhostIdent().empty()) - replacements["VHOST"] = na->GetVhostIdent() + "@" + na->GetVhostHost(); - else - replacements["VHOST"] = na->GetVhostHost(); - } + replacements["VHOST"] = na->GetVhostMask(); if (ServiceReference<Command>("Command", "hostserv/request")) replacements["CAN_REQUEST"] = "YES"; TemplateFileServer page("hostserv/request.html"); diff --git a/modules/webcpanel/pages/nickserv/info.cpp b/modules/webcpanel/pages/nickserv/info.cpp index 54b9c75c5..6a47e541c 100644 --- a/modules/webcpanel/pages/nickserv/info.cpp +++ b/modules/webcpanel/pages/nickserv/info.cpp @@ -81,12 +81,7 @@ bool WebCPanel::NickServ::Info::OnRequest(HTTPProvider *server, const Anope::str replacements["EMAIL"] = na->nc->email; replacements["TIME_REGISTERED"] = Anope::strftime(na->time_registered, na->nc); if (na->HasVhost()) - { - if (!na->GetVhostIdent().empty()) - replacements["VHOST"] = na->GetVhostIdent() + "@" + na->GetVhostHost(); - else - replacements["VHOST"] = na->GetVhostHost(); - } + replacements["VHOST"] = na->GetVhostMask(); Anope::string *greet = na->nc->GetExt<Anope::string>("greet"); if (greet) replacements["GREET"] = *greet; |
