summaryrefslogtreecommitdiff
path: root/modules/nickserv
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-09 19:51:39 -0400
committerAdam <Adam@anope.org>2016-10-09 19:51:39 -0400
commite7dd7159b1e1ab5b3edabc44ece5338672f8fbb4 (patch)
tree9517f02ca1c29fa247f6914398f35a44052c22ff /modules/nickserv
parent8ceca4fd3f9cb82bc93801d5eb682d27b2ad2f54 (diff)
Make vhosts assignable to accounts, not nicks. Allow multiple vhosts per account.
Diffstat (limited to 'modules/nickserv')
-rw-r--r--modules/nickserv/info.cpp18
-rw-r--r--modules/nickserv/main/nick.cpp9
-rw-r--r--modules/nickserv/main/nick.h4
-rw-r--r--modules/nickserv/main/nicktype.cpp1
-rw-r--r--modules/nickserv/main/nicktype.h2
5 files changed, 7 insertions, 27 deletions
diff --git a/modules/nickserv/info.cpp b/modules/nickserv/info.cpp
index e782edbaa..447554afb 100644
--- a/modules/nickserv/info.cpp
+++ b/modules/nickserv/info.cpp
@@ -107,15 +107,11 @@ class CommandNSInfo : public Command
if (!na->GetAccount()->GetEmail().empty() && (show_hidden || !na->GetAccount()->HasFieldS("HIDE_EMAIL")))
info[_("Email address")] = na->GetAccount()->GetEmail();
- if (show_hidden)
+ if (source.HasPriv("hostserv/auspex"))
{
- HostServ::VHost *vhost = na->GetVHost();
- if (vhost != nullptr)
+ for (HostServ::VHost *vhost : na->GetAccount()->GetRefs<HostServ::VHost *>())
{
- if (IRCD->CanSetVIdent && !vhost->GetIdent().empty())
- info[_("VHost")] = vhost->GetIdent() + "@" + vhost->GetHost();
- else
- info[_("VHost")] = vhost->GetHost();
+ info[_("VHost")] = vhost->Mask() + (vhost->IsDefault() ? " (default)" : "");
}
}
@@ -132,10 +128,10 @@ class CommandNSInfo : public Command
{
this->SendSyntax(source);
source.Reply(" ");
- source.Reply(_("Displays information about the given nickname, such as\n"
- "the nick's owner, last seen address and time, and nick\n"
- "options. If no nick is given, and you are identified,\n"
- "your account name is used, else your current nickname is\n"
+ source.Reply(_("Displays information about the given nickname, such as "
+ "the nick's owner, last seen address and time, and nick "
+ "options. If no nick is given, and you are identified, "
+ "your account name is used, else your current nickname is "
"used."));
return true;
diff --git a/modules/nickserv/main/nick.cpp b/modules/nickserv/main/nick.cpp
index 88f618855..0f94e63af 100644
--- a/modules/nickserv/main/nick.cpp
+++ b/modules/nickserv/main/nick.cpp
@@ -136,12 +136,3 @@ void NickImpl::SetAccount(NickServ::Account *acc)
Set(&NickType::nc, acc);
}
-HostServ::VHost *NickImpl::GetVHost()
-{
- return Get(&NickType::vhost);
-}
-
-void NickImpl::SetVHost(HostServ::VHost *vhost)
-{
- Set(&NickType::vhost, vhost);
-} \ No newline at end of file
diff --git a/modules/nickserv/main/nick.h b/modules/nickserv/main/nick.h
index 6c174739a..69f47efe8 100644
--- a/modules/nickserv/main/nick.h
+++ b/modules/nickserv/main/nick.h
@@ -24,7 +24,6 @@ class NickImpl : public NickServ::Nick
NickServ::Account *account = nullptr;
Anope::string nick, last_quit, last_realname, last_usermask, last_realhost;
time_t time_registered = 0, last_seen = 0;
- HostServ::VHost *vhost = nullptr;
public:
NickImpl(Serialize::TypeBase *type) : NickServ::Nick(type) { }
@@ -55,7 +54,4 @@ class NickImpl : public NickServ::Nick
NickServ::Account *GetAccount() override;
void SetAccount(NickServ::Account *acc) override;
-
- HostServ::VHost *GetVHost() override;
- void SetVHost(HostServ::VHost *) override;
};
diff --git a/modules/nickserv/main/nicktype.cpp b/modules/nickserv/main/nicktype.cpp
index f27d27e18..7b72f3e42 100644
--- a/modules/nickserv/main/nicktype.cpp
+++ b/modules/nickserv/main/nicktype.cpp
@@ -29,7 +29,6 @@ NickType::NickType(Module *me) : Serialize::Type<NickImpl>(me)
, time_registered(this, "time_registered", &NickImpl::time_registered)
, last_seen(this, "last_seen", &NickImpl::last_seen)
, nc(this, "nc", &NickImpl::account)
- , vhost(this, "vhost", &NickImpl::vhost)
{
}
diff --git a/modules/nickserv/main/nicktype.h b/modules/nickserv/main/nicktype.h
index 08e556b0a..d94265132 100644
--- a/modules/nickserv/main/nicktype.h
+++ b/modules/nickserv/main/nicktype.h
@@ -40,8 +40,6 @@ class NickType : public Serialize::Type<NickImpl>
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
Serialize::ObjectField<NickImpl, NickServ::Account *> nc;
- Serialize::ObjectField<NickImpl, HostServ::VHost *> vhost;
-
NickType(Module *);
NickServ::Nick *FindNick(const Anope::string &nick);