diff options
author | Adam <Adam@anope.org> | 2016-10-09 12:00:15 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-10-09 12:00:15 -0400 |
commit | 5fd2d0ee3e136e01926f21edc759a4ab9fd48806 (patch) | |
tree | 6666be3d14db12fe66a3576e889423f64e5229cc /include/modules | |
parent | cffbf4e8fd93ae28f1c6d6fde221e72d70015942 (diff) |
Split vhosts into its own structure
Diffstat (limited to 'include/modules')
-rw-r--r-- | include/modules/hostserv.h | 50 | ||||
-rw-r--r-- | include/modules/nickserv.h | 24 |
2 files changed, 53 insertions, 21 deletions
diff --git a/include/modules/hostserv.h b/include/modules/hostserv.h new file mode 100644 index 000000000..4e6661faa --- /dev/null +++ b/include/modules/hostserv.h @@ -0,0 +1,50 @@ +/* + * Anope IRC Services + * + * Copyright (C) 2016 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include "serialize.h" + +namespace HostServ +{ + class VHost : public Serialize::Object + { + protected: + using Serialize::Object::Object; + + public: + static constexpr const char *const NAME = "vhost"; + + virtual Serialize::Object *GetOwner() anope_abstract; + virtual void SetOwner(Serialize::Object *) anope_abstract; + + virtual Anope::string GetIdent() anope_abstract; + virtual void SetIdent(const Anope::string &) anope_abstract; + + virtual Anope::string GetHost() anope_abstract; + virtual void SetHost(const Anope::string &) anope_abstract; + + virtual Anope::string GetCreator() anope_abstract; + virtual void SetCreator(const Anope::string &) anope_abstract; + + virtual time_t GetCreated() anope_abstract; + virtual void SetCreated(time_t) anope_abstract; + }; +} + diff --git a/include/modules/nickserv.h b/include/modules/nickserv.h index 43e2a21ce..1ecb2a933 100644 --- a/include/modules/nickserv.h +++ b/include/modules/nickserv.h @@ -22,6 +22,7 @@ #include "event.h" #include "service.h" #include "serialize.h" +#include "hostserv.h" namespace NickServ { @@ -169,27 +170,8 @@ namespace NickServ virtual Account *GetAccount() anope_abstract; virtual void SetAccount(Account *acc) anope_abstract; - /** Set a vhost for the user - * @param ident The ident - * @param host The host - * @param creator Who created the vhost - * @param time When the vhost was craated - */ - virtual void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime) anope_abstract; - virtual void RemoveVhost() anope_abstract; - virtual bool HasVhost() anope_abstract; - - virtual Anope::string GetVhostIdent() anope_abstract; - virtual void SetVhostIdent(const Anope::string &) anope_abstract; - - virtual Anope::string GetVhostHost() anope_abstract; - virtual void SetVhostHost(const Anope::string &) anope_abstract; - - virtual Anope::string GetVhostCreator() anope_abstract; - virtual void SetVhostCreator(const Anope::string &) anope_abstract; - - virtual time_t GetVhostCreated() anope_abstract; - virtual void SetVhostCreated(const time_t &) anope_abstract; + virtual HostServ::VHost *GetVHost() anope_abstract; + virtual void SetVHost(HostServ::VHost *) anope_abstract; }; /* A registered account. Each account must have a Nick with the same nick as the |