1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 13:46:38 +02:00
Files
anope/src/nickcore.cpp
T
DukePyrolator 4bf22fa2e6 added more events
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2461 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-22 04:39:22 +00:00

82 lines
1.3 KiB
C++

#include "services.h"
#include "pseudo.h"
NickCore::NickCore()
{
next = prev = NULL;
display = email = greet = url = NULL;
ot = NULL;
pass[0] = '\0';
icq = flags = 0;
language = channelcount = 0;
lastmail = 0;
}
bool NickCore::HasCommand(const std::string &cmdstr) const
{
if (!this->ot)
{
// No opertype.
return false;
}
return this->ot->HasCommand(cmdstr);
}
bool NickCore::IsServicesOper() const
{
if (this->ot)
return true;
return false;
}
bool NickCore::HasPriv(const std::string &privstr) const
{
if (!this->ot)
{
// No opertype.
return false;
}
return this->ot->HasPriv(privstr);
}
void NickCore::AddAccess(const std::string &entry)
{
access.push_back(entry);
}
std::string NickCore::GetAccess(unsigned entry)
{
if (access.empty() || entry >= access.size())
return "";
return access[entry];
}
bool NickCore::FindAccess(const std::string &entry)
{
for (unsigned i = 0; i < access.size(); ++i)
if (access[i] == entry)
return true;
return false;
}
void NickCore::EraseAccess(const std::string &entry)
{
for (unsigned i = 0; i < access.size(); ++i)
if (access[i] == entry)
{
FOREACH_MOD(I_OnNickEraseAccess, OnNickEraseAccess(this, entry));
access.erase(access.begin() + i);
break;
}
}
void NickCore::ClearAccess()
{
FOREACH_MOD(I_OnNickClearAccess, OnNickClearAccess(this));
access.clear();
}