diff options
73 files changed, 1060 insertions, 521 deletions
diff --git a/data/chanserv.example.conf b/data/chanserv.example.conf index c60a58621..22881217c 100644 --- a/data/chanserv.example.conf +++ b/data/chanserv.example.conf @@ -65,27 +65,27 @@ module * - keeptopic: Retain topic when the channel is not in use * - peace: Disallow users from kicking or removing modes from others who are of the same * access level or superior - * - cs_private: Hide the channel from ChanServ's LIST command + * - private: Hide the channel from ChanServ's LIST command * - restricted: Kick/ban users who are restricted from the channel - * - cs_secure: Enable channel security, requiring the user to be identified with NickServ in + * - secure: Enable channel security, requiring the user to be identified with NickServ in * order to be considered for being on the access list of the channel * - secureops: Only allow operator status to be given if the user is on the access list * - securefounder: Only allow the real founder of the channel to drop the channel, change it's * password, or change the founder or successor * - signkick: Use of ChanServ's KICK command will cause the user's nick to be signed to the kick. - * - signkick_level: Same as above, but the kick will not be signed if the user is at the same access + * - signkicklevel: Same as above, but the kick will not be signed if the user is at the same access * level or superior to the target * - topiclock: Disallow the topic to be changed except with ChanServ's TOPIC command * - persist: Keep the channel open at all times * - noautoop: Disables autoop on the channel - * - cs_keep_modes: Enables keep modes on the channel, which retains modes when the channel is + * - keepmodes: Enables keep modes on the channel, which retains modes when the channel is * not in use. * - none: No defaults * * This directive is optional, if left blank, the options will default to keeptopic, chanserv/secure, securefounder, * and signkick. If you really want no defaults, use "none" by itself as the option. */ - defaults = "keeptopic peace cs_secure securefounder signkick" + defaults = "keeptopic peace secure securefounder signkick" /* * The maximum number of channels which may be registered to a single nickname. diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf index 1f07831c4..ceef600ab 100644 --- a/data/nickserv.example.conf +++ b/data/nickserv.example.conf @@ -83,11 +83,11 @@ module * * The options are: * - killprotect: Kill nick if not identified within 60 seconds - * - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the above + * - killquick: Kill nick if not identified within 20 seconds, this one overrides the above * option and the above must be specified with this one - * - ns_secure: Enable nickname security, requiring the nick's password before any operations + * - secure: Enable nickname security, requiring the nick's password before any operations * can be done on it - * - ns_private: Hide the nick from NickServ's LIST command + * - private: Hide the nick from NickServ's LIST command * - hide_email: Hide's the nick's e-mail address from NickServ's INFO command * - hide_mask: Hide's the nick's last or current user@host from NickServ's INFO command * - hide_quit: Hide's the nick's last quit message @@ -97,13 +97,13 @@ module * - autoop: User will be automatically opped in channels they enter and have access to * - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires * options:useprivmsg to be enabled as well - * - ns_keepmodes: Enables keepmodes, which retains user modes across sessions - * - ns_no_expire: Enables no expire. Unconfirmed expire overrules this. + * - keepmodes: Enables keepmodes, which retains user modes across sessions + * - noexpire: Enables no expire. Unconfirmed expire overrules this. * * This directive is optional, if left blank, the options will default to nickserv/secure, memo_signon, and * memo_receive. If you really want no defaults, use "none" by itself as the option. */ - defaults = "ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop" + defaults = "secure private hide_email hide_mask memo_signon memo_receive autoop" /* * The minimum length of time between consecutive uses of NickServ's REGISTER command. This diff --git a/include/modules/chanserv/channel.h b/include/modules/chanserv/channel.h index 3ba5e7561..29e8ef9d7 100644 --- a/include/modules/chanserv/channel.h +++ b/include/modules/chanserv/channel.h @@ -27,12 +27,10 @@ class CoreExport Channel : public Serialize::Object public: ::Channel *c = nullptr; /* Pointer to channel, if the channel exists */ - protected: - using Serialize::Object::Object; - - public: static constexpr const char *const NAME = "channel"; + using Serialize::Object::Object; + virtual Anope::string GetName() anope_abstract; virtual void SetName(const Anope::string &) anope_abstract; @@ -40,10 +38,10 @@ class CoreExport Channel : public Serialize::Object virtual void SetDesc(const Anope::string &) anope_abstract; virtual time_t GetTimeRegistered() anope_abstract; - virtual void SetTimeRegistered(const time_t &) anope_abstract; + virtual void SetTimeRegistered(time_t) anope_abstract; virtual time_t GetLastUsed() anope_abstract; - virtual void SetLastUsed(const time_t &) anope_abstract; + virtual void SetLastUsed(time_t) anope_abstract; virtual Anope::string GetLastTopic() anope_abstract; virtual void SetLastTopic(const Anope::string &) anope_abstract; @@ -52,13 +50,13 @@ class CoreExport Channel : public Serialize::Object virtual void SetLastTopicSetter(const Anope::string &) anope_abstract; virtual time_t GetLastTopicTime() anope_abstract; - virtual void SetLastTopicTime(const time_t &) anope_abstract; + virtual void SetLastTopicTime(time_t) anope_abstract; virtual int16_t GetBanType() anope_abstract; - virtual void SetBanType(const int16_t &) anope_abstract; + virtual void SetBanType(int16_t) anope_abstract; virtual time_t GetBanExpire() anope_abstract; - virtual void SetBanExpire(const time_t &) anope_abstract; + virtual void SetBanExpire(time_t) anope_abstract; virtual BotInfo *GetBI() anope_abstract; virtual void SetBI(BotInfo *) anope_abstract; @@ -66,6 +64,58 @@ class CoreExport Channel : public Serialize::Object virtual ServiceBot *GetBot() anope_abstract; virtual void SetBot(ServiceBot *) anope_abstract; + /** Whether or not greets are enabled. + */ + virtual bool IsGreet() anope_abstract; + virtual void SetGreet(bool) anope_abstract; + + /** Whether or not fantasy is enabled. + */ + virtual bool IsFantasy() anope_abstract; + virtual void SetFantasy(bool) anope_abstract; + + virtual bool IsNoAutoop() anope_abstract; + virtual void SetNoAutoop(bool) anope_abstract; + + virtual bool IsPeace() anope_abstract; + virtual void SetPeace(bool) anope_abstract; + + virtual bool IsSecureFounder() anope_abstract; + virtual void SetSecureFounder(bool) anope_abstract; + + virtual bool IsRestricted() anope_abstract; + virtual void SetRestricted(bool) anope_abstract; + + virtual bool IsSecure() anope_abstract; + virtual void SetSecure(bool) anope_abstract; + + virtual bool IsSecureOps() anope_abstract; + virtual void SetSecureOps(bool) anope_abstract; + + virtual bool IsSignKick() anope_abstract; + virtual void SetSignKick(bool) anope_abstract; + + virtual bool IsSignKickLevel() anope_abstract; + virtual void SetSignKickLevel(bool) anope_abstract; + + virtual bool IsNoExpire() anope_abstract; + virtual void SetNoExpire(bool) anope_abstract; + + virtual bool IsKeepModes() anope_abstract; + virtual void SetKeepModes(bool) anope_abstract; + + virtual bool IsPersist() anope_abstract; + virtual void SetPersist(bool) anope_abstract; + + virtual bool IsTopicLock() anope_abstract; + virtual void SetTopicLock(bool) anope_abstract; + + virtual bool IsKeepTopic() anope_abstract; + virtual void SetKeepTopic(bool) anope_abstract; + + virtual bool IsPrivate() anope_abstract; + virtual void SetPrivate(bool) anope_abstract; + /** Is the user the real founder? * @param user The user * @return true or false @@ -198,4 +248,4 @@ class CoreExport Channel : public Serialize::Object }; -} // namespace ChanServ
\ No newline at end of file +} // namespace ChanServ diff --git a/include/modules/memoserv.h b/include/modules/memoserv.h index 1268facef..8c39b5a5e 100644 --- a/include/modules/memoserv.h +++ b/include/modules/memoserv.h @@ -144,6 +144,9 @@ namespace MemoServ virtual int16_t GetMemoMax() anope_abstract; virtual void SetMemoMax(const int16_t &) anope_abstract; + virtual bool IsHardMax() anope_abstract; + virtual void SetHardMax(bool) anope_abstract; + virtual std::vector<Memo *> GetMemos() anope_abstract; virtual std::vector<Ignore *> GetIgnores() anope_abstract; }; diff --git a/include/modules/nickserv/account.h b/include/modules/nickserv/account.h index f0ba144f7..511b1220f 100644 --- a/include/modules/nickserv/account.h +++ b/include/modules/nickserv/account.h @@ -24,13 +24,13 @@ namespace NickServ /* A registered account. Each account must have a Nick with the same nick as the * account's display. - * It matters that Base is here before Extensible (it is inherited by Serializable) */ class CoreExport Account : public Serialize::Object { public: static constexpr const char *const NAME = "account"; +#warning "this gets lost" /* Last time an email was sent to this user */ time_t lastmail = 0; /* Users online now logged into this account */ @@ -53,6 +53,57 @@ class CoreExport Account : public Serialize::Object virtual Oper *GetOper() anope_abstract; virtual void SetOper(Oper *) anope_abstract; + virtual Anope::string GetGreet() anope_abstract; + virtual void SetGreet(const Anope::string &) anope_abstract; + + virtual bool IsUnconfirmed() anope_abstract; + virtual void SetUnconfirmed(bool) anope_abstract; + + virtual bool IsPrivate() anope_abstract; + virtual void SetPrivate(bool) anope_abstract; + + virtual bool IsAutoOp() anope_abstract; + virtual void SetAutoOp(bool) anope_abstract; + + virtual bool IsKeepModes() anope_abstract; + virtual void SetKeepModes(bool) anope_abstract; + + virtual bool IsKillProtect() anope_abstract; + virtual void SetKillProtect(bool) anope_abstract; + + virtual bool IsKillQuick() anope_abstract; + virtual void SetKillQuick(bool) anope_abstract; + + virtual bool IsKillImmed() anope_abstract; + virtual void SetKillImmed(bool) anope_abstract; + + virtual bool IsMsg() anope_abstract; + virtual void SetMsg(bool) anope_abstract; + + virtual bool IsSecure() anope_abstract; + virtual void SetSecure(bool) anope_abstract; + + virtual bool IsMemoSignon() anope_abstract; + virtual void SetMemoSignon(bool) anope_abstract; + + virtual bool IsMemoReceive() anope_abstract; + virtual void SetMemoReceive(bool) anope_abstract; + + virtual bool IsMemoMail() anope_abstract; + virtual void SetMemoMail(bool) anope_abstract; + + virtual bool IsHideEmail() anope_abstract; + virtual void SetHideEmail(bool) anope_abstract; + + virtual bool IsHideMask() anope_abstract; + virtual void SetHideMask(bool) anope_abstract; + + virtual bool IsHideStatus() anope_abstract; + virtual void SetHideStatus(bool) anope_abstract; + + virtual bool IsHideQuit() anope_abstract; + virtual void SetHideQuit(bool) anope_abstract; + /** Changes the display for this account * @param na The new display, must be grouped to this account. */ diff --git a/include/modules/nickserv/ajoin.h b/include/modules/nickserv/ajoin.h index c23eecbe9..9f060402c 100644 --- a/include/modules/nickserv/ajoin.h +++ b/include/modules/nickserv/ajoin.h @@ -25,8 +25,8 @@ class AutoJoin : public Serialize::Object public: static constexpr const char *const NAME = "autojoin"; - virtual NickServ::Account *GetOwner() anope_abstract; - virtual void SetOwner(NickServ::Account *acc) anope_abstract; + virtual NickServ::Account *GetAccount() anope_abstract; + virtual void SetAccount(NickServ::Account *acc) anope_abstract; virtual Anope::string GetChannel() anope_abstract; virtual void SetChannel(const Anope::string &c) anope_abstract; diff --git a/include/modules/nickserv/nick.h b/include/modules/nickserv/nick.h index 604bc02d6..3579e7d0d 100644 --- a/include/modules/nickserv/nick.h +++ b/include/modules/nickserv/nick.h @@ -55,6 +55,9 @@ class CoreExport Nick : public Serialize::Object virtual Account *GetAccount() anope_abstract; virtual void SetAccount(Account *acc) anope_abstract; + + virtual bool IsNoExpire() anope_abstract; + virtual void SetNoExpire(bool) anope_abstract; }; -} // namespace NickServ
\ No newline at end of file +} // namespace NickServ diff --git a/modules/botserv/assign.cpp b/modules/botserv/assign.cpp index 95691b6a9..eca103e9f 100644 --- a/modules/botserv/assign.cpp +++ b/modules/botserv/assign.cpp @@ -140,7 +140,7 @@ class CommandBSUnassign : public Command return; } - if (ci->HasFieldS("PERSIST") && !ModeManager::FindChannelModeByName("PERM")) + if (ci->IsPersist() && !ModeManager::FindChannelModeByName("PERM")) { source.Reply(_("You cannot unassign bots while persist is set on the channel.")); return; diff --git a/modules/botserv/badwords.cpp b/modules/botserv/badwords.cpp index 1348c8aff..914e89ea9 100644 --- a/modules/botserv/badwords.cpp +++ b/modules/botserv/badwords.cpp @@ -50,7 +50,7 @@ class BadWordsType : public Serialize::Type<BadWordImpl> Serialize::Field<BadWordImpl, BadWordType> type; BadWordsType(Module *me) : Serialize::Type<BadWordImpl>(me) - , channel(this, "ci", &BadWordImpl::channel, true) + , channel(this, "channel", &BadWordImpl::channel, true) , word(this, "word", &BadWordImpl::word) , type(this, "type", &BadWordImpl::type) { diff --git a/modules/botserv/main/botserv.cpp b/modules/botserv/main/botserv.cpp index a297db153..c6e1c6413 100644 --- a/modules/botserv/main/botserv.cpp +++ b/modules/botserv/main/botserv.cpp @@ -127,7 +127,7 @@ class BotServCore : public Module, public BotServ::BotServService void OnLeaveChannel(User *u, Channel *c) override { /* Channel is persistent, it shouldn't be deleted and the service bot should stay */ - if (c->ci && c->ci->HasFieldS("PERSIST")) + if (c->ci && c->ci->IsPersist()) return; /* Channel is syncing from a netburst, don't destroy it as more users are probably wanting to join immediately @@ -219,7 +219,7 @@ class BotServCore : public Module, public BotServ::BotServService /* Set default bot flags */ spacesepstream sep(Config->GetModule(this)->Get<Anope::string>("defaults", "greet fantasy")); for (Anope::string token; sep.GetToken(token);) - ci->SetS<bool>("BS_" + token.upper(), true); + ci->SetS<bool>(token, true); } void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) override diff --git a/modules/chanserv/akick.cpp b/modules/chanserv/akick.cpp index d253d6fb5..1930cb20b 100644 --- a/modules/chanserv/akick.cpp +++ b/modules/chanserv/akick.cpp @@ -58,10 +58,10 @@ class AutoKickImpl : public AutoKick class AutoKickType : public Serialize::Type<AutoKickImpl> { public: - Serialize::ObjectField<AutoKickImpl, ChanServ::Channel *> ci; + Serialize::ObjectField<AutoKickImpl, ChanServ::Channel *> channel; Serialize::Field<AutoKickImpl, Anope::string> mask; - Serialize::ObjectField<AutoKickImpl, NickServ::Account *> nc; + Serialize::ObjectField<AutoKickImpl, NickServ::Account *> account; Serialize::Field<AutoKickImpl, Anope::string> reason; Serialize::Field<AutoKickImpl, Anope::string> creator; @@ -70,9 +70,9 @@ class AutoKickType : public Serialize::Type<AutoKickImpl> AutoKickType(Module *me) : Serialize::Type<AutoKickImpl>(me) - , ci(this, "ci", &AutoKickImpl::channel, true) + , channel(this, "channel", &AutoKickImpl::channel, true) , mask(this, "mask", &AutoKickImpl::mask) - , nc(this, "nc", &AutoKickImpl::account, true) + , account(this, "account", &AutoKickImpl::account, true) , reason(this, "reason", &AutoKickImpl::reason) , creator(this, "creator", &AutoKickImpl::creator) , addtime(this, "addtime", &AutoKickImpl::addtime) @@ -83,12 +83,12 @@ class AutoKickType : public Serialize::Type<AutoKickImpl> ChanServ::Channel *AutoKickImpl::GetChannel() { - return Get(&AutoKickType::ci); + return Get(&AutoKickType::channel); } void AutoKickImpl::SetChannel(ChanServ::Channel *ci) { - Set(&AutoKickType::ci, ci); + Set(&AutoKickType::channel, ci); } Anope::string AutoKickImpl::GetMask() @@ -103,12 +103,12 @@ void AutoKickImpl::SetMask(const Anope::string &mask) NickServ::Account *AutoKickImpl::GetAccount() { - return Get(&AutoKickType::nc); + return Get(&AutoKickType::account); } void AutoKickImpl::SetAccount(NickServ::Account *nc) { - Set(&AutoKickType::nc, nc); + Set(&AutoKickType::account, nc); } Anope::string AutoKickImpl::GetReason() @@ -170,7 +170,7 @@ class CommandCSAKick : public Command { /* Also don't try to complete the mask if this is a channel */ - if (mask.equals_ci(ci->GetName()) && ci->HasFieldS("PEACE")) + if (mask.equals_ci(ci->GetName()) && ci->IsPeace()) { source.Reply(_("Access denied.")); return; @@ -232,7 +232,7 @@ class CommandCSAKick : public Command ; /* Check whether target nick has equal/higher access * or whether the mask matches a user with higher/equal access - Viper * |
