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

#include <regchannel.h>

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

Public Member Functions

 ChannelInfo (const Anope::string &chname)
 
 ChannelInfo (const ChannelInfo &ci)
 
 ~ChannelInfo ()
 
void Serialize (Serialize::Data &data) const anope_override
 
void SetFounder (NickCore *nc)
 
NickCoreGetFounder () const
 
void SetSuccessor (NickCore *nc)
 
NickCoreGetSuccessor () const
 
BotInfoWhoSends () const
 
void AddAccess (ChanAccess *access)
 
ChanAccessGetAccess (unsigned index) const
 
AccessGroup AccessFor (const User *u)
 
AccessGroup AccessFor (const NickCore *nc)
 
unsigned GetAccessCount () const
 
unsigned GetDeepAccessCount () const
 
ChanAccessEraseAccess (unsigned index)
 
void ClearAccess ()
 
AutoKickAddAkick (const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t=Anope::CurTime, time_t lu=0)
 
AutoKickAddAkick (const Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t=Anope::CurTime, time_t lu=0)
 
AutoKickGetAkick (unsigned index) const
 
unsigned GetAkickCount () const
 
void EraseAkick (unsigned index)
 
void ClearAkick ()
 
int16_t GetLevel (const Anope::string &priv) const
 
void SetLevel (const Anope::string &priv, int16_t level)
 
void RemoveLevel (const Anope::string &priv)
 
void ClearLevels ()
 
Anope::string GetIdealBan (User *u) const
 
void AddChannelReference (const Anope::string &what)
 
void RemoveChannelReference (const Anope::string &what)
 
void GetChannelReferences (std::deque< Anope::string > &chans)
 
- 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 ChannelInfoFind (const Anope::string &name)
 
- 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 name
 
Anope::string desc
 
time_t time_registered
 
time_t last_used
 
Anope::string last_topic
 
Anope::string last_topic_setter
 
time_t last_topic_time
 
Channel::ModeList last_modes
 
int16_t bantype
 
MemoInfo memos
 
Channelc
 
Serialize::Reference< BotInfobi
 
time_t banexpire
 
- Data Fields inherited from Serializable
uint64_t id
 
unsigned short redis_ignore
 
- Data Fields inherited from Extensible
std::set< ExtensibleBase * > extension_items
 

Private Attributes

Anope::map< int > references
 
Serialize::Reference< NickCorefounder
 
Serialize::Reference< NickCoresuccessor
 
Serialize::Checker
< std::vector< ChanAccess * > > 
access
 
Serialize::Checker
< std::vector< AutoKick * > > 
akick
 
Anope::map< int16_t > levels
 

Friends

class ChanAccess
 
class AutoKick
 

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 48 of file regchannel.h.

Constructor & Destructor Documentation

ChannelInfo::ChannelInfo ( const Anope::string chname)
ChannelInfo::ChannelInfo ( const ChannelInfo ci)
ChannelInfo::~ChannelInfo ( )

Member Function Documentation

AccessGroup ChannelInfo::AccessFor ( const User u)
AccessGroup ChannelInfo::AccessFor ( const NickCore nc)
void ChannelInfo::AddAccess ( ChanAccess access)

Add an entry to the channel access list

Parameters
accessThe entry

Definition at line 398 of file regchannel.cpp.

References access.

Referenced by ChannelInfo(), CommandCSAccess::DoAdd(), CommandCSXOP::DoAdd(), CommandCSFlags::DoModify(), CommandCSClone::Execute(), LoadChannels(), WebCPanel::ChanServ::Access::OnRequest(), and ChanAccess::Unserialize().

AutoKick * ChannelInfo::AddAkick ( const Anope::string user,
NickCore akicknc,
const Anope::string reason,
time_t  t = Anope::CurTime,
time_t  lu = 0 
)

Add an akick entry to the channel by NickCore

Parameters
userThe user who added the akick
akickncThe nickcore being akicked
reasonThe reason for the akick
tThe time the akick was added, defaults to now
luThe time the akick was last used, defaults to never

Definition at line 519 of file regchannel.cpp.

References NickCore::AddChannelReference(), AutoKick::addtime, akick, AutoKick, AutoKick::ci, AutoKick::creator, AutoKick::last_used, AutoKick::nc, and AutoKick::reason.

Referenced by ChannelInfo(), CommandCSAKick::DoAdd(), CommandCSClone::Execute(), LoadChannels(), and AutoKick::Unserialize().

AutoKick * ChannelInfo::AddAkick ( const Anope::string user,
const Anope::string mask,
const Anope::string reason,
time_t  t = Anope::CurTime,
time_t  lu = 0 
)

Add an akick entry to the channel by reason

Parameters
userThe user who added the akick
maskThe mask of the akick
reasonThe reason for the akick
tThe time the akick was added, defaults to now
luThe time the akick was last used, defaults to never

Definition at line 536 of file regchannel.cpp.

References AutoKick::addtime, akick, AutoKick, AutoKick::ci, AutoKick::creator, AutoKick::last_used, AutoKick::mask, AutoKick::nc, and AutoKick::reason.

void ChannelInfo::AddChannelReference ( const Anope::string what)

Definition at line 657 of file regchannel.cpp.

References references.

Referenced by ChanAccess::SetMask().

void ChannelInfo::ClearAccess ( )

Clear the entire channel access list

Clears the entire access list by deleting every item and then clearing the vector.

Definition at line 513 of file regchannel.cpp.

References access, and GetAccess().

Referenced by CommandCSFlags::DoClear(), CommandCSAccess::DoClear(), and ~ChannelInfo().

void ChannelInfo::ClearAkick ( )

Clear the whole akick list

Definition at line 575 of file regchannel.cpp.

References akick.

Referenced by CommandCSAKick::DoClear(), CommandCSClone::Execute(), and ~ChannelInfo().

void ChannelInfo::ClearLevels ( )

Clear all privileges from the channel

Definition at line 605 of file regchannel.cpp.

References levels.

Referenced by reset_levels().

ChanAccess * ChannelInfo::EraseAccess ( unsigned  index)

Erase an entry from the channel access list

Parameters
indexThe index in the access list vector
Returns
The erased entry

Definition at line 503 of file regchannel.cpp.

References access.

Referenced by CommandCSAccess::DoAdd(), CommandCSXOP::DoAdd(), CommandCSXOP::DoClear(), CommandCSXOP::DoDel(), CommandCSAccess::DoDel(), CommandCSFlags::DoModify(), and ChanServCore::OnDelCore().

void ChannelInfo::EraseAkick ( unsigned  index)

Erase an entry from the channel akick list

Parameters
indexThe index of the akick

Definition at line 567 of file regchannel.cpp.

References akick, and GetAkick().

Referenced by CommandCSAKick::DoDel(), and ChanServCore::OnDelCore().

ChannelInfo * ChannelInfo::Find ( const Anope::string name)
static

Finds a ChannelInfo

Parameters
namechannel name to lookup
Returns
the ChannelInfo associated with the channel

Definition at line 630 of file regchannel.cpp.

References RegisteredChannelList.

Referenced by Channel::Channel(), CommandBSKickBase::CheckArguments(), CommandCSAccess::DoAdd(), CommandCSXOP::DoAdd(), CommandMSSet::DoLimit(), CommandCSFlags::DoModify(), CommandCSSetChanstats::Execute(), CommandCSRegister::Execute(), CommandBSSetGreet::Execute(), CommandMSCancel::Execute(), CommandMSInfo::Execute(), CommandMSList::Execute(), CommandBSAssign::Execute(), CommandBSSetFantasy::Execute(), CommandCSDrop::Execute(), CommandCSGetKey::Execute(), CommandBSSay::Execute(), CommandCSStatus::Execute(), CommandCSSync::Execute(), CommandCSUnban::Execute(), CommandCSClone::Execute(), CommandCSInfo::Execute(), CommandCSKick::Execute(), CommandCSSetKeepTopic::Execute(), CommandMSIgnore::Execute(), CommandCSBan::Execute(), CommandMSDel::Execute(), CommandBSInfo::Execute(), CommandCSSuspend::Execute(), CommandCSSetAutoOp::Execute(), CommandBSSetBanExpire::Execute(), CommandBSAct::Execute(), CommandBSUnassign::Execute(), CommandCSSetMisc::Execute(), CommandMSRead::Execute(), CommandOSInfo::Execute(), CommandCSLog::Execute(), CommandCSSetBanType::Execute(), CommandCSUnSuspend::Execute(), CommandBSSetNoBot::Execute(), CommandCSTopic::Execute(), CommandCSSetPrivate::Execute(), CommandEntryMessage::Execute(), CommandCSSetDescription::Execute(), CommandCSEnforce::Execute(), CommandCSSetFounder::Execute(), CommandCSSetKeepModes::Execute(), CommandBSBadwords::Execute(), CommandCSFlags::Execute(), CommandCSSetPeace::Execute(), CommandCSAKick::Execute(), CommandCSSetPersist::Execute(), CommandCSXOP::Execute(), CommandCSAccess::Execute(), CommandCSSetRestricted::Execute(), CommandCSMode::Execute(), CommandCSSetSecure::Execute(), CommandCSLevels::Execute(), CommandCSModes::Execute(), CommandCSSetSecureFounder::Execute(), CommandBSSetDontKickOps::Execute(), CommandCSSetSecureOps::Execute(), CommandBSSetDontKickVoices::Execute(), CommandCSSetSignKick::Execute(), CommandCSSetSuccessor::Execute(), CommandCSSetNoexpire::Execute(), OperInfos::Find(), MemoInfo::GetMemoInfo(), ChanAccess::Matches(), ChanServCore::OnDelChan(), WebCPanel::ChanServ::Akick::OnRequest(), WebCPanel::ChanServ::Modes::OnRequest(), WebCPanel::MemoServ::Memos::OnRequest(), WebCPanel::ChanServ::Access::OnRequest(), WebCPanel::ChanServ::Set::OnRequest(), NSAJoin::OnUserLogin(), MemoServCore::Send(), ChanAccess::SetMask(), ShouldHide(), BadWordImpl::Unserialize(), CSSuspendInfo::Unserialize(), ModeLockImpl::Unserialize(), EntryMsgImpl::Unserialize(), AutoKick::Unserialize(), LogSettingImpl::Unserialize(), CSMiscData::Unserialize(), ChanAccess::Unserialize(), BadWordImpl::~BadWordImpl(), ChanAccess::~ChanAccess(), EntryMsgImpl::~EntryMsgImpl(), LogSettingImpl::~LogSettingImpl(), and ModeLockImpl::~ModeLockImpl().

ChanAccess * ChannelInfo::GetAccess ( unsigned  index) const

Get an entry from the channel access list by index

Parameters
indexThe index in the access list vector
Returns
A ChanAccess struct corresponding to the index given, or NULL if outside the bounds

Retrieves an entry from the access list that matches the given index.

Definition at line 403 of file regchannel.cpp.

References access, and Serializable::QueueUpdate().

Referenced by AccessFor(), ChannelInfo(), ClearAccess(), CommandCSAccess::DoAdd(), CommandCSXOP::DoAdd(), CommandCSXOP::DoClear(), CommandCSXOP::DoDel(), CommandCSAccess::DoDel(), CommandCSFlags::DoList(), CommandCSXOP::DoList(), CommandCSFlags::DoModify(), CommandCSClone::Execute(), GetDeepAccessCount(), ChanAccess::Matches(), ChanServCore::OnDelChan(), ChanServCore::OnDelCore(), WebCPanel::ChanServ::Access::OnRequest(), and CommandCSAccess::ProcessList().

unsigned ChannelInfo::GetAccessCount ( ) const
AutoKick * ChannelInfo::GetAkick ( unsigned  index) const

Get an entry from the channel akick list

Parameters
indexThe index in the akick vector
Returns
The akick structure, or NULL if not found

Definition at line 552 of file regchannel.cpp.

References akick, and Serializable::QueueUpdate().

Referenced by ChannelInfo(), CommandCSAKick::DoAdd(), CommandCSAKick::DoDel(), EraseAkick(), CommandCSStatus::Execute(), CommandCSClone::Execute(), ChanServCore::OnDelCore(), WebCPanel::ChanServ::Akick::OnRequest(), and CommandCSAKick::ProcessList().

unsigned ChannelInfo::GetAkickCount ( ) const
void ChannelInfo::GetChannelReferences ( std::deque< Anope::string > &  chans)

Definition at line 669 of file regchannel.cpp.

References references.

unsigned ChannelInfo::GetDeepAccessCount ( ) const

Get the number of access entries for this channel, including those that are on other channels.

Definition at line 479 of file regchannel.cpp.

References GetAccess(), GetAccessCount(), and ChanAccess::Matches().

Referenced by CommandCSAccess::DoAdd(), CommandCSXOP::DoAdd(), CommandCSFlags::DoModify(), and CommandCSClone::Execute().

NickCore * ChannelInfo::GetFounder ( ) const
Anope::string ChannelInfo::GetIdealBan ( User u) const

Gets a ban mask for the given user based on the bantype of the channel.

Parameters
uThe user
Returns
A ban mask that affects the user

Definition at line 610 of file regchannel.cpp.

References bantype, User::GetDisplayedHost(), User::GetVIdent(), and User::Mask().

Referenced by BSKick::check_ban(), CommandCSEnforce::DoRegOnly(), CommandCSEnforce::DoRestricted(), and CommandCSEnforce::DoSSLOnly().

int16_t ChannelInfo::GetLevel ( const Anope::string priv) const

Get the level for a privilege

Parameters
privThe privilege name
Returns
the level
Exceptions
CoreExceptionif priv is not a valid privilege

Definition at line 581 of file regchannel.cpp.

References ACCESS_INVALID, PrivilegeManager::FindPrivilege(), levels, and LOG_DEBUG.

Referenced by CommandCSLevels::DoList().

NickCore * ChannelInfo::GetSuccessor ( ) const
void ChannelInfo::RemoveChannelReference ( const Anope::string what)

Definition at line 662 of file regchannel.cpp.

References references.

Referenced by ChanAccess::SetMask(), and ChanAccess::~ChanAccess().

void ChannelInfo::RemoveLevel ( const Anope::string priv)

Remove a privilege from the channel

Parameters
privThe privilege

Definition at line 600 of file regchannel.cpp.

References levels.

void ChannelInfo::Serialize ( Serialize::Data data) const
virtual
void ChannelInfo::SetFounder ( NickCore nc)

Change the founder of the channek nc The new founder

Definition at line 347 of file regchannel.cpp.

References founder.

Referenced by CommandCSRegister::Execute(), CommandCSSetFounder::Execute(), LoadChannels(), ChanServCore::OnDelCore(), and ~ChannelInfo().

void ChannelInfo::SetLevel ( const Anope::string priv,
int16_t  level 
)

Set the level for a privilege

Parameters
privThe privilege priv
levelThe new level

Definition at line 595 of file regchannel.cpp.

References levels.

Referenced by CommandCSLevels::DoDisable(), CommandCSLevels::DoSet(), LoadChannels(), and reset_levels().

void ChannelInfo::SetSuccessor ( NickCore nc)
Serializable * ChannelInfo::Unserialize ( Serializable obj,
Serialize::Data data 
)
static
BotInfo * ChannelInfo::WhoSends ( ) const

Find which bot should send mode/topic/etc changes for this channel

Returns
The bot

Definition at line 383 of file regchannel.cpp.

References bi, and BotListByNick.

Referenced by CommandCSInvite::Execute(), CommandCSKick::Execute(), and ChanServCore::OnPreUplinkSync().

Friends And Related Function Documentation

friend class AutoKick
friend

Definition at line 61 of file regchannel.h.

Referenced by AddAkick().

friend class ChanAccess
friend

Definition at line 60 of file regchannel.h.

Field Documentation

Serialize::Checker<std::vector<ChanAccess *> > ChannelInfo::access
private

Definition at line 55 of file regchannel.h.

Referenced by AddAccess(), ChannelInfo(), ClearAccess(), EraseAccess(), GetAccess(), and GetAccessCount().

Serialize::Checker<std::vector<AutoKick *> > ChannelInfo::akick
private

Definition at line 56 of file regchannel.h.

Referenced by AddAkick(), ChannelInfo(), ClearAkick(), EraseAkick(), GetAkick(), and GetAkickCount().

time_t ChannelInfo::banexpire

Definition at line 84 of file regchannel.h.

Referenced by ChannelInfo(), CommandBSSetBanExpire::Execute(), and Serialize().

int16_t ChannelInfo::bantype
Serialize::Reference<BotInfo> ChannelInfo::bi
Channel* ChannelInfo::c
Anope::string ChannelInfo::desc
Serialize::Reference<NickCore> ChannelInfo::founder
private

Definition at line 53 of file regchannel.h.

Referenced by AccessFor(), ChannelInfo(), GetFounder(), Serialize(), SetFounder(), and ~ChannelInfo().

Channel::ModeList ChannelInfo::last_modes
Anope::string ChannelInfo::last_topic
Anope::string ChannelInfo::last_topic_setter
time_t ChannelInfo::last_topic_time
time_t ChannelInfo::last_used
Anope::map<int16_t> ChannelInfo::levels
private

Definition at line 57 of file regchannel.h.

Referenced by ClearLevels(), GetLevel(), RemoveLevel(), Serialize(), and SetLevel().

MemoInfo ChannelInfo::memos
Anope::string ChannelInfo::name

Definition at line 63 of file regchannel.h.

Referenced by BadWordsImpl::AddBadWord(), CommandCSTopic::Append(), WebCPanel::ChanServ::BuildChanList(), ChannelInfo(), ChannelSort(), CommandNSAList::ChannelSort(), CSMiscData::CSMiscData(), CommandCSAKick::DoAdd(), CommandCSAccess::DoAdd(), CommandCSXOP::DoAdd(), CommandEntryMessage::DoAdd(), CommandBSBadwords::DoAdd(), CommandCSEnforce::DoBans(), CommandEntryMessage::DoClear(), CommandCSFlags::DoClear(), CommandCSAKick::DoClear(), CommandCSXOP::DoClear(), CommandCSAccess::DoClear(), CommandEntryMessage::DoDel(), CommandCSAKick::DoDel(), CommandCSXOP::DoDel(), CommandCSAccess::DoDel(), CommandBSBadwords::DoDelete(), CommandCSLevels::DoDisable(), CommandCSAKick::DoEnforce(), CommandCSEnforce::DoLimit(), CommandEntryMessage::DoList(), CommandBSBadwords::DoList(), CommandCSFlags::DoList(), CommandCSAKick::DoList(), CommandCSXOP::DoList(), CommandCSAccess::DoList(), CommandCSLevels::DoList(), CommandCSMode::DoLock(), CommandCSFlags::DoModify(), MemoListCallback::DoRead(), CommandCSEnforce::DoRegOnly(), CommandCSLevels::DoReset(), CommandCSEnforce::DoRestricted(), CommandCSEnforce::DoSecureOps(), CommandCSLevels::DoSet(), CommandCSEnforce::DoSSLOnly(), CommandCSAKick::DoView(), CommandCSAccess::DoView(), EntryMsgImpl::EntryMsgImpl(), CommandBSAssign::Execute(), CommandBSSay::Execute(), CommandCSStatus::Execute(), CommandCSSync::Execute(), CommandCSUnban::Execute(), CommandBSSetGreet::Execute(), CommandMSCancel::Execute(), CommandBSSetFantasy::Execute(), CommandMSList::Execute(), CommandCSClone::Execute(), CommandCSSetKeepTopic::Execute(), CommandCSList::Execute(), CommandNSAList::Execute(), CommandMSDel::Execute(), CommandBSInfo::Execute(), CommandCSSuspend::Execute(), CommandCSSetAutoOp::Execute(), CommandBSAct::Execute(), CommandBSUnassign::Execute(), CommandCSSetMisc::Execute(), CommandCSLog::Execute(), CommandCSSetBanType::Execute(), CommandOSForbid::Execute(), CommandCSUnSuspend::Execute(), CommandBSSetNoBot::Execute(), CommandCSTopic::Execute(), CommandCSSetPrivate::Execute(), CommandCSSetDescription::Execute(), CommandCSEnforce::Execute(), CommandCSSetFounder::Execute(), CommandCSSetKeepModes::Execute(), CommandCSSetPeace::Execute(), CommandCSSetPersist::Execute(), CommandCSSetRestricted::Execute(), CommandCSSetSecure::Execute(), CommandCSModes::Execute(), CommandCSSetSecureFounder::Execute(), CommandBSSetDontKickOps::Execute(), CommandCSSetSecureOps::Execute(), CommandBSSetDontKickVoices::Execute(), CommandCSSetSignKick::Execute(), CommandCSSetSuccessor::Execute(), CommandCSSetNoexpire::Execute(), CSSet::Persist::ExtensibleUnserialize(), MemoDelCallback::HandleNumber(), LoadChannels(), CommandCSTopic::Lock(), ChanServCore::OnDelCore(), ChanServCore::OnExpireTick(), ChanServCore::OnPreUplinkSync(), BSKick::OnPrivmsg(), WebCPanel::ChanServ::Drop::OnRequest(), WebCPanel::ChanServ::Access::OnRequest(), WebCPanel::ChanServ::Set::OnRequest(), WebCPanel::NickServ::Alist::OnRequest(), WebCPanel::ChanServ::Modes::OnRequest(), WebCPanel::ChanServ::Akick::OnRequest(), WebCPanel::MemoServ::Memos::OnRequest(), CommandCSAKick::ProcessList(), CommandCSAccess::ProcessList(), LogInfo::ProcessMessage(), MemoServCore::Send(), CommandBSInfo::send_bot_channels(), Serialize(), ModeLocksImpl::SetMLock(), CommandCSTopic::Unlock(), ModeLockImpl::Unserialize(), EntryMsgImpl::Unserialize(), LogSettingImpl::Unserialize(), CSMiscData::Unserialize(), BadwordsDelCallback::~BadwordsDelCallback(), and ~ChannelInfo().

Anope::map<int> ChannelInfo::references
private

Definition at line 51 of file regchannel.h.

Referenced by AddChannelReference(), GetChannelReferences(), and RemoveChannelReference().

Serialize::Reference<NickCore> ChannelInfo::successor
private

Definition at line 54 of file regchannel.h.

Referenced by ChannelInfo(), GetSuccessor(), Serialize(), and SetSuccessor().

time_t ChannelInfo::time_registered

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