expirationDate = exp;
}
-String
-BanEntry::getMask()
+const Mask&
+BanEntry::getMask() const
{
- return banMask.getMask();
+ return banMask;
}
#include "Mask.H"
-class Commands;
-class UserCommands;
-
class BanEntry {
Mask banMask;
std::time_t expirationDate;
std::time_t getExpirationDate() const;
void setExpirationDate(std::time_t);
- String getMask();
-
- friend class Commands;
- friend class UserCommands;
+ const Mask& getMask() const;
};
#endif
{
for (std::vector<BanEntry *>::iterator it = channelBanlist.begin();
it != channelBanlist.end(); ++it)
- if ((*it)->getMask() == mask) {
+ if ((*it)->getMask().getMask() == mask) {
if (expiration > (*it)->getExpirationDate())
(*it)->setExpirationDate(expiration);
return;
{
for (std::vector<BanEntry *>::iterator it = channelBanlist.begin();
it != channelBanlist.end(); ++it)
- if (mask == (*it)->getMask()) {
+ if (mask == (*it)->getMask().getMask()) {
BanEntry *b = *it;
channelBanlist.erase(it);
delete b;
for (std::vector<BanEntry *>::iterator it = c->channelBanlist.begin();
it != c->channelBanlist.end(); ++it)
- if (m.matches((*it)->banMask) && (*it)->banMask.getMask() != m.getMask())
- QUEUE->sendChannelMode(channel, "-b", (*it)->banMask.getMask());
+ if (m.matches((*it)->getMask ()) && (*it)->getMask().getMask() != m.getMask())
+ QUEUE->sendChannelMode(channel, "-b", (*it)->getMask().getMask());
QUEUE->sendChannelMode(channel, "+b", dest);
it != c->channelBanlist.end(); ++it)
if (m.matches((*it)->getMask())) {
// Let's see if the ban is in the shitlist
- ShitEntry *se = bot->shitList->getShit((*it)->getMask(), channel);
+ ShitEntry *se = bot->shitList->getShit((*it)->getMask().getMask(), channel);
if (!se || !se->isStillValid() ||
se->getShitLevel() < ShitEntry::SHIT_NODEBAN)
- QUEUE->sendChannelMode(channel, "-b", (*it)->getMask());
+ QUEUE->sendChannelMode(channel, "-b", (*it)->getMask().getMask());
}
return Ok;
for (std::vector<BanEntry *>::iterator it = c->channelBanlist.begin();
it != c->channelBanlist.end(); ++it)
{
- if (m.matches((*it)->banMask))
+ if (m.matches((*it)->getMask ()))
{
- QUEUE->sendChannelMode(channel, "-b", (*it)->banMask.getMask());
+ QUEUE->sendChannelMode(channel, "-b", (*it)->getMask().getMask());
}
}
for (std::vector<BanEntry *>::iterator it = c->channelBanlist.begin();
it != c->channelBanlist.end(); ++it)
if ((*it)->getExpirationDate() == -1)
- from->sendNotice((*it)->getMask().pad(30) + " -1");
+ from->sendNotice((*it)->getMask().getMask().pad(30) + " -1");
else
- from->sendNotice((*it)->getMask().pad(30) + " " +
+ from->sendNotice((*it)->getMask().getMask().pad(30) + " " +
String((long)((*it)->getExpirationDate()-current)));
from->sendNotice("\002End of banlist.\002");
}
for (std::vector<BanEntry *>::iterator it = c->channelBanlist.begin();
it != c->channelBanlist.end(); ++it)
- if (m.matches((*it)->banMask))
- cnx->queue->sendChannelMode(channel, "-b", (*it)->banMask.getMask());
+ if (m.matches((*it)->getMask()))
+ cnx->queue->sendChannelMode(channel, "-b", (*it)->getMask().getMask());
cnx->bot->channelList->getChannel(channel)->addBan(dest, w);
cnx->queue->sendChannelMode(channel, "+b", dest);