diff options
| author | Adam <Adam@anope.org> | 2017-05-29 12:49:22 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2017-05-29 13:11:16 -0400 |
| commit | 3f143633541a5361bf5b02b0d69b65447aea7b79 (patch) | |
| tree | 3a33bd044bc8936150dcab38f355f3c3726b05e5 /modules/nickserv/main | |
| parent | e36d24a6c500b5ad921041fcb905f684c09d71e9 (diff) | |
Remove recognized status and secure
Also remove /ns status, which is now almost useless with no recognized
status, and /ns access.
Diffstat (limited to 'modules/nickserv/main')
| -rw-r--r-- | modules/nickserv/main/account.cpp | 28 | ||||
| -rw-r--r-- | modules/nickserv/main/account.h | 5 | ||||
| -rw-r--r-- | modules/nickserv/main/accounttype.cpp | 1 | ||||
| -rw-r--r-- | modules/nickserv/main/accounttype.h | 2 | ||||
| -rw-r--r-- | modules/nickserv/main/nickserv.cpp | 53 |
5 files changed, 21 insertions, 68 deletions
diff --git a/modules/nickserv/main/account.cpp b/modules/nickserv/main/account.cpp index 0ff20420b..9c3275cbe 100644 --- a/modules/nickserv/main/account.cpp +++ b/modules/nickserv/main/account.cpp @@ -19,7 +19,6 @@ #include "module.h" #include "accounttype.h" -#include "modules/nickserv/access.h" AccountImpl::~AccountImpl() { @@ -187,16 +186,6 @@ void AccountImpl::SetMsg(bool msg) Set(&AccountType::msg, msg); } -bool AccountImpl::IsSecure() -{ - return Get(&AccountType::secure); -} - -void AccountImpl::SetSecure(bool secure) -{ - Set(&AccountType::secure, secure); -} - bool AccountImpl::IsMemoSignon() { return Get(&AccountType::memosignon); @@ -288,23 +277,6 @@ void AccountImpl::SetDisplay(NickServ::Nick *na) nc = this; } -bool AccountImpl::IsOnAccess(User *u) -{ - Anope::string buf = u->GetIdent() + "@" + u->host, buf2, buf3; - if (!u->vhost.empty()) - buf2 = u->GetIdent() + "@" + u->vhost; - if (!u->GetCloakedHost().empty()) - buf3 = u->GetIdent() + "@" + u->GetCloakedHost(); - - for (NickAccess *access : GetRefs<NickAccess *>()) - { - Anope::string a = access->GetMask(); - if (Anope::Match(buf, a) || (!buf2.empty() && Anope::Match(buf2, a)) || (!buf3.empty() && Anope::Match(buf3, a))) - return true; - } - return false; -} - unsigned int AccountImpl::GetChannelCount() { unsigned int i = 0; diff --git a/modules/nickserv/main/account.h b/modules/nickserv/main/account.h index 8f8b0e123..39424faf3 100644 --- a/modules/nickserv/main/account.h +++ b/modules/nickserv/main/account.h @@ -34,7 +34,6 @@ class AccountImpl : public NickServ::Account Serialize::Storage<bool> killquick; Serialize::Storage<bool> killimmed; Serialize::Storage<bool> msg; - Serialize::Storage<bool> secure; Serialize::Storage<bool> memosignon, memoreceive, memomail; Serialize::Storage<bool> hideemail, hidemask, hidestatus, hidequit; Serialize::Storage<time_t> lastmail; @@ -88,9 +87,6 @@ class AccountImpl : public NickServ::Account bool IsMsg() override; void SetMsg(bool) override; - bool IsSecure() override; - void SetSecure(bool) override; - bool IsMemoSignon() override; void SetMemoSignon(bool) override; @@ -115,7 +111,6 @@ class AccountImpl : public NickServ::Account MemoServ::MemoInfo *GetMemos() override; void SetDisplay(NickServ::Nick *na) override; - bool IsOnAccess(User *u) override; unsigned int GetChannelCount() override; time_t GetLastMail() override; diff --git a/modules/nickserv/main/accounttype.cpp b/modules/nickserv/main/accounttype.cpp index 4c951a698..0f4ebbd16 100644 --- a/modules/nickserv/main/accounttype.cpp +++ b/modules/nickserv/main/accounttype.cpp @@ -35,7 +35,6 @@ AccountType::AccountType(Module *me) : Serialize::Type<AccountImpl>(me) , killquick(this, "killquick", &AccountImpl::killquick) , killimmed(this, "killimmed", &AccountImpl::killimmed) , msg(this, "msg", &AccountImpl::msg) - , secure(this, "secure", &AccountImpl::secure) , memosignon(this, "memo_signon", &AccountImpl::memosignon) , memoreceive(this, "memo_receive", &AccountImpl::memoreceive) , memomail(this, "memo_mail", &AccountImpl::memomail) diff --git a/modules/nickserv/main/accounttype.h b/modules/nickserv/main/accounttype.h index 6fa1bbaa3..1a6ab37cd 100644 --- a/modules/nickserv/main/accounttype.h +++ b/modules/nickserv/main/accounttype.h @@ -37,7 +37,7 @@ class AccountType : public Serialize::Type<AccountImpl> Serialize::ObjectField<AccountImpl, Oper *> oper; Serialize::Field<AccountImpl, Anope::string> greet; Serialize::Field<AccountImpl, bool> unconfirmed, _private, autoop, keepmodes, - killprotect, killquick, killimmed, msg, secure, memosignon, memoreceive, + killprotect, killquick, killimmed, msg, memosignon, memoreceive, memomail, hideemail, hidemask, hidestatus, hidequit; Serialize::Field<AccountImpl, time_t> last_mail; diff --git a/modules/nickserv/main/nickserv.cpp b/modules/nickserv/main/nickserv.cpp index ba20a0108..ab6a06af3 100644 --- a/modules/nickserv/main/nickserv.cpp +++ b/modules/nickserv/main/nickserv.cpp @@ -244,45 +244,32 @@ class NickServCore : public Module, public NickServ::NickServService if (MOD_RESULT == EVENT_ALLOW) return; - if (!na->GetAccount()->IsSecure() && u->IsRecognized()) - { - na->SetLastSeen(Anope::CurTime); - na->SetLastUsermask(u->GetIdent() + "@" + u->GetDisplayedHost()); - na->SetLastRealname(u->realname); + if (Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership")) return; - } - if (Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership")) + if (!na->GetAccount()->IsKillProtect()) return; - bool on_access = u->IsRecognized(false); + if (na->GetAccount()->IsKillImmed()) + { + u->SendMessage(*NickServ, _("This nickname has been registered; you may not use it.")); + this->Collide(u, na); + return; + } + + u->SendMessage(*NickServ, _("This nickname is registered. If this is your nickname, type \002{0}{1} IDENTIFY \037password\037\002. Otherwise, please choose a different nickname."), Config->StrictPrivmsg, NickServ->nick); // XXX - if (on_access || !na->GetAccount()->IsKillImmed()) + if (na->GetAccount()->IsKillQuick()) { - if (na->GetAccount()->IsSecure()) - u->SendMessage(*NickServ, _("This nickname is registered and protected. If this is your nickname, type \002{0}{1} IDENTIFY \037password\037\002. Otherwise, please choose a different nickname."), Config->StrictPrivmsg, NickServ->nick); // XXX - else - u->SendMessage(*NickServ, _("This nickname is owned by someone else. If this is your nickname, type \002{0}{1} IDENTIFY \037password\037\002. Otherwise, please choose a different nickname."), Config->StrictPrivmsg, NickServ->nick); // XXX + time_t killquick = Config->GetModule("nickserv/main")->Get<time_t>("killquick", "20s"); + u->SendMessage(*NickServ, _("If you do not change within {0}, I will change your nick."), Anope::Duration(killquick, u->Account())); + new NickServCollide(this, this, u, na, killquick); } - if (na->GetAccount()->IsKillProtect() && !on_access) + else { - if (na->GetAccount()->IsKillImmed()) - { - u->SendMessage(*NickServ, _("This nickname has been registered; you may not use it.")); - this->Collide(u, na); - } - else if (na->GetAccount()->IsKillQuick()) - { - time_t killquick = Config->GetModule("nickserv/main")->Get<time_t>("killquick", "20s"); - u->SendMessage(*NickServ, _("If you do not change within %s, I will change your nick."), Anope::Duration(killquick, u->Account()).c_str()); - new NickServCollide(this, this, u, na, killquick); - } - else - { - time_t kill = Config->GetModule("nickserv/main")->Get<time_t>("kill", "60s"); - u->SendMessage(*NickServ, _("If you do not change within %s, I will change your nick."), Anope::Duration(kill, u->Account()).c_str()); - new NickServCollide(this, this, u, na, kill); - } + time_t kill = Config->GetModule("nickserv/main")->Get<time_t>("kill", "60s"); + u->SendMessage(*NickServ, _("If you do not change within {0}, I will change your nick."), Anope::Duration(kill, u->Account())); + new NickServCollide(this, this, u, na, kill); } } @@ -626,7 +613,7 @@ class NickServCore : public Module, public NickServ::NickServService /* Update last quit and last seen for the user */ NickServ::Nick *na = NickServ::FindNick(u->nick); - if (na && !na->GetAccount()->HasFieldS("NS_SUSPENDED") && (u->IsRecognized() || u->IsIdentified(true))) + if (na && !na->GetAccount()->HasFieldS("NS_SUSPENDED") && u->IsIdentified(true)) { na->SetLastSeen(Anope::CurTime); na->SetLastQuit(msg); @@ -643,7 +630,7 @@ class NickServCore : public Module, public NickServ::NickServService for (NickServ::Nick *na : Serialize::GetObjects<NickServ::Nick *>()) { User *u = User::Find(na->GetNick(), true); - if (u && (u->IsIdentified(true) || u->IsRecognized())) + if (u && u->IsIdentified(true)) na->SetLastSeen(Anope::CurTime); bool expire = false; |
