Anope IRC Services  Version 2.0
Public Member Functions | Static Public Member Functions | Data Fields | Private Attributes
NickCore Class Reference

#include <account.h>

Inheritance diagram for NickCore:
Inheritance graph
[legend]
Collaboration diagram for NickCore:
Collaboration graph
[legend]

Public Member Functions

 NickCore (const Anope::string &nickdisplay)
 
 ~NickCore ()
 
void Serialize (Serialize::Data &data) const anope_override
 
void SetDisplay (const NickAlias *na)
 
virtual bool IsServicesOper () const
 
void AddAccess (const Anope::string &entry)
 
Anope::string GetAccess (unsigned entry) const
 
unsigned GetAccessCount () const
 
bool FindAccess (const Anope::string &entry)
 
void EraseAccess (const Anope::string &entry)
 
void ClearAccess ()
 
bool IsOnAccess (const User *u) const
 
void AddChannelReference (ChannelInfo *ci)
 
void RemoveChannelReference (ChannelInfo *ci)
 
void GetChannelReferences (std::deque< ChannelInfo * > &queue)
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 
void QueueUpdate ()
 
bool IsCached (Serialize::Data &)
 
void UpdateCache (Serialize::Data &)
 
bool IsTSCached ()
 
void UpdateTS ()
 
Serialize::TypeGetSerializableType () const
 
- Public Member Functions inherited from Base
 Base ()
 
virtual ~Base ()
 
void AddReference (ReferenceBase *r)
 
void DelReference (ReferenceBase *r)
 
- Public Member Functions inherited from Extensible
virtual ~Extensible ()
 
template<typename T >
T * GetExt (const Anope::string &name) const
 
bool HasExt (const Anope::string &name) const
 
template<typename T >
T * Extend (const Anope::string &name, const T &what)
 
template<typename T >
T * Extend (const Anope::string &name)
 
template<typename T >
T * Require (const Anope::string &name)
 
template<typename T >
void Shrink (const Anope::string &name)
 
template<>
bool * Extend (const Anope::string &name, const bool &what)
 

Static Public Member Functions

static SerializableUnserialize (Serializable *obj, Serialize::Data &)
 
static NickCoreFind (const Anope::string &nick)
 
- Static Public Member Functions inherited from Serializable
static const std::list
< Serializable * > & 
GetItems ()
 
- Static Public Member Functions inherited from Extensible
static void ExtensibleSerialize (const Extensible *, const Serializable *, Serialize::Data &data)
 
static void ExtensibleUnserialize (Extensible *, Serializable *, Serialize::Data &data)
 

Data Fields

Anope::string display
 
Anope::string pass
 
Anope::string email
 
Anope::string language
 
std::vector< Anope::stringaccess
 
MemoInfo memos
 
std::map< Anope::string,
Anope::string
last_modes
 
Serialize::Checker
< std::vector< NickAlias * > > 
aliases
 
Opero
 
uint16_t channelcount
 
time_t lastmail
 
std::list< User * > users
 
- Data Fields inherited from Serializable
uint64_t id
 
unsigned short redis_ignore
 
- Data Fields inherited from Extensible
std::set< ExtensibleBase * > extension_items
 

Private Attributes

Serialize::Checker< std::map
< ChannelInfo *, int > > 
chanaccess
 

Additional Inherited Members

- Protected Member Functions inherited from Serializable
 Serializable (const Anope::string &serialize_type)
 
 Serializable (const Serializable &)
 
Serializableoperator= (const Serializable &)
 

Detailed Description

Definition at line 107 of file account.h.

Constructor & Destructor Documentation

NickCore::NickCore ( const Anope::string nickdisplay)

Constructor

Parameters
displayThe display nick

Definition at line 20 of file nickcore.cpp.

References channelcount, display, Anope::string::empty(), FOREACH_MOD, lastmail, LOG_DEBUG, NickCoreList, and o.

Referenced by Unserialize().

NickCore::~NickCore ( )

Member Function Documentation

void NickCore::AddAccess ( const Anope::string entry)

Add an entry to the nick's access list

Parameters
entryThe nick!ident entry to add to the access list

Adds a new entry into the access list.

Definition at line 178 of file nickcore.cpp.

References access, and FOREACH_MOD.

Referenced by CommandNSAccess::DoAdd().

void NickCore::AddChannelReference ( ChannelInfo ci)

Definition at line 239 of file nickcore.cpp.

References chanaccess.

Referenced by ChannelInfo::AddAkick().

void NickCore::ClearAccess ( )

Clears the entire nick's access list

Deletes all the memory allocated in the access list vector and then clears the vector.

Definition at line 216 of file nickcore.cpp.

References access, and FOREACH_MOD.

Referenced by ~NickCore().

void NickCore::EraseAccess ( const Anope::string entry)

Erase an entry from the nick's access list

Parameters
entryThe nick!ident entry to remove

Removes the specified access list entry from the access list.

Definition at line 205 of file nickcore.cpp.

References access, and FOREACH_MOD.

Referenced by CommandNSAccess::DoDel().

NickCore * NickCore::Find ( const Anope::string nick)
static

Finds an account

Parameters
nickThe account name to find
Returns
The account, if it exists

Definition at line 258 of file nickcore.cpp.

References NickCoreList.

Referenced by LoadChannels(), LoadNicks(), IRCDMessageEncap::Run(), IRCDMessageMetadata::Run(), MyOper::Unserialize(), AutoKick::Unserialize(), AJoinEntry::Unserialize(), NSMiscData::Unserialize(), NickAlias::Unserialize(), and ChannelInfo::Unserialize().

bool NickCore::FindAccess ( const Anope::string entry)

Find an entry in the nick's access list

Parameters
entryThe nick!ident entry to search for
Returns
True if the entry is found in the access list, false otherwise

Search for an entry within the access list.

Definition at line 196 of file nickcore.cpp.

References access.

Referenced by CommandNSAccess::DoAdd(), and CommandNSAccess::DoDel().

Anope::string NickCore::GetAccess ( unsigned  entry) const

Get an entry from the nick's access list by index

Parameters
entryIndex in the access list vector to retrieve
Returns
The access list entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds

Retrieves an entry from the access list corresponding to the given index.

Definition at line 184 of file nickcore.cpp.

References access.

Referenced by CommandNSAccess::DoList(), and IsOnAccess().

unsigned NickCore::GetAccessCount ( ) const

Get the number of entries on the access list for this account.

Definition at line 191 of file nickcore.cpp.

References access.

void NickCore::GetChannelReferences ( std::deque< ChannelInfo * > &  queue)

Definition at line 251 of file nickcore.cpp.

References chanaccess.

Referenced by CommandNSAList::Execute().

bool NickCore::IsOnAccess ( const User u) const

Is the given user on this accounts access list?

Parameters
uThe user
Returns
true if the user is on the access list

Definition at line 222 of file nickcore.cpp.

References access, Anope::string::empty(), GetAccess(), User::GetCloakedHost(), User::GetIdent(), User::host, Anope::Match(), and User::vhost.

bool NickCore::IsServicesOper ( ) const
virtual

Checks whether this account is a services oper or not.

Returns
True if this account is a services oper, false otherwise.

Definition at line 173 of file nickcore.cpp.

References o.

Referenced by CommandMSStaff::Execute(), CommandNSSASetPassword::Execute(), CommandSource::IsOper(), CommandSource::IsServicesOper(), ChanServCore::OnDelCore(), and CommandNSSetEmail::Run().

void NickCore::RemoveChannelReference ( ChannelInfo ci)

Definition at line 244 of file nickcore.cpp.

References chanaccess.

void NickCore::Serialize ( Serialize::Data data) const
virtual
void NickCore::SetDisplay ( const NickAlias na)

Changes the display for this account

Parameters
naThe new display, must be grouped to this account.

Definition at line 154 of file nickcore.cpp.

References aliases, display, FOREACH_MOD, NickAlias::nc, NickAlias::nick, and NickCoreList.

Referenced by CommandNSUngroup::Execute().

Serializable * NickCore::Unserialize ( Serializable obj,
Serialize::Data data 
)
static

Field Documentation

std::vector<Anope::string> NickCore::access
Serialize::Checker<std::vector<NickAlias *> > NickCore::aliases
Serialize::Checker<std::map<ChannelInfo *, int> > NickCore::chanaccess
private
uint16_t NickCore::channelcount
Anope::string NickCore::display

Definition at line 113 of file account.h.

Referenced by CommandNSAccess::DoAdd(), CommandNSAJoin::DoAdd(), CommandNSCert::DoAdd(), CommandNSAccess::DoDel(), CommandNSAJoin::DoDel(), CommandNSCert::DoDel(), CommandCSXOP::DoDel(), CommandNSAccess::DoList(), CommandNSAJoin::DoList(), CommandNSCert::DoList(), MyXMLRPCEvent::DoUser(), CommandCSRegister::Execute(), CommandCSDrop::Execute(), CommandCSInfo::Execute(), CommandNSStatus::Execute(), CommandNSGetEMail::Execute(), CommandNSAList::Execute(), CommandMSSendAll::Execute(), CommandMSStaff::Execute(), CommandHSDelAll::Execute(), CommandNSSuspend::Execute(), CommandNSGroup::Execute(), CommandNSAccess::Execute(), CommandNSSASetPassword::Execute(), CommandNSUngroup::Execute(), CommandNSAJoin::Execute(), CommandNSCert::Execute(), CommandCSSetFounder::Execute(), CommandNSGList::Execute(), CommandCSSetSuccessor::Execute(), Log::FormatSource(), MChanstats::GetDisplay(), MemoDelCallback::HandleNumber(), MemoInfo::HasIgnore(), LoadNicks(), NickCore(), NSMiscData::NSMiscData(), ChanServCore::OnDelCore(), ChanServCore::OnExpireTick(), NSCert::OnFingerprint(), NSCert::OnNickValidate(), WebCPanel::ChanServ::Set::OnRequest(), IdentifyInterface::OnResult(), SQLOperResult::OnResult(), OnIdentifyInterface::OnResult(), NSIdentifyRequest::OnSuccess(), NSRecoverRequest::OnSuccess(), IRC2SQL::OnUserConnect(), IRC2SQL::OnUserLogin(), External::ProcessMessage(), LogInfo::ProcessMessage(), rsend_notify(), CommandNSSetGreet::Run(), CommandNSSetMisc::Run(), IRCDMessageEncap::Run(), CommandNSSetHide::Run(), CommandNSSetPrivate::Run(), CommandNSSetAutoOp::Run(), CommandNSSetEmail::Run(), CommandNSSetKeepModes::Run(), CommandNSSetKill::Run(), CommandNSSetLanguage::Run(), CommandNSSetMessage::Run(), CommandNSSetSecure::Run(), Mail::Send(), MemoServCore::SendMemoMail(), AJoinEntry::Serialize(), Serialize(), SetDisplay(), ModeLocksImpl::SetMLock(), MyOper::Unserialize(), NSMiscData::Unserialize(), and ~NickCore().

Anope::string NickCore::email
Anope::string NickCore::language
std::map<Anope::string, Anope::string> NickCore::last_modes
time_t NickCore::lastmail

Definition at line 138 of file account.h.

Referenced by NickCore(), and Mail::Send().

MemoInfo NickCore::memos
Oper* NickCore::o
Anope::string NickCore::pass
std::list<User *> NickCore::users

Definition at line 140 of file account.h.

Referenced by CommandOSOper::Execute(), User::Login(), and ~NickCore().


The documentation for this class was generated from the following files: