本文整理汇总了C++中ChannelInfo::GetBadWord方法的典型用法代码示例。如果您正苦于以下问题:C++ ChannelInfo::GetBadWord方法的具体用法?C++ ChannelInfo::GetBadWord怎么用?C++ ChannelInfo::GetBadWord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChannelInfo
的用法示例。
在下文中一共展示了ChannelInfo::GetBadWord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
delete target_ci;
target_ci = new ChannelInfo(*ci);
target_ci->name = target;
RegisteredChannelList[target_ci->name] = target_ci;
target_ci->c = findchan(target_ci->name);
if (target_ci->c)
{
target_ci->c->ci = target_ci;
check_modes(target_ci->c);
ChannelMode *cm;
if (u->FindChannel(target_ci->c) != NULL)
{
/* On most ircds you do not receive the admin/owner mode till its registered */
if ((cm = ModeManager::FindChannelModeByName(CMODE_OWNER)))
target_ci->c->SetMode(NULL, cm, u->nick);
else if ((cm = ModeManager::FindChannelModeByName(CMODE_PROTECT)))
target_ci->c->RemoveMode(NULL, cm, u->nick);
}
/* Mark the channel as persistent */
if (target_ci->c->HasMode(CMODE_PERM))
target_ci->SetFlag(CI_PERSIST);
/* Persist may be in def cflags, set it here */
else if (target_ci->HasFlag(CI_PERSIST) && (cm = ModeManager::FindChannelModeByName(CMODE_PERM)))
target_ci->c->SetMode(NULL, CMODE_PERM);
if (target_ci->bi && target_ci->c->FindUser(target_ci->bi) == NULL)
target_ci->bi->Join(target_ci->c, &Config->BotModeList);
}
if (target_ci->c && !target_ci->c->topic.empty())
{
target_ci->last_topic = target_ci->c->topic;
target_ci->last_topic_setter = target_ci->c->topic_setter;
target_ci->last_topic_time = target_ci->c->topic_time;
}
else
target_ci->last_topic_setter = source.owner->nick;
FOREACH_MOD(I_OnChanRegistered, OnChanRegistered(target_ci));
source.Reply(_("All settings from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str());
}
else if (what.equals_ci("ACCESS"))
{
for (unsigned i = 0; i < ci->GetAccessCount(); ++i)
{
ChanAccess *taccess = ci->GetAccess(i);
AccessProvider *provider = taccess->provider;
ChanAccess *newaccess = provider->Create();
newaccess->ci = target_ci;
newaccess->mask = taccess->mask;
newaccess->creator = taccess->creator;
newaccess->last_seen = taccess->last_seen;
newaccess->created = taccess->created;
newaccess->Unserialize(taccess->Serialize());
target_ci->AddAccess(newaccess);
}
source.Reply(_("All access entries from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str());
}
else if (what.equals_ci("AKICK"))
{
target_ci->ClearAkick();
for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
{
AutoKick *akick = ci->GetAkick(i);
if (akick->HasFlag(AK_ISNICK))
target_ci->AddAkick(akick->creator, akick->nc, akick->reason, akick->addtime, akick->last_used);
else
target_ci->AddAkick(akick->creator, akick->mask, akick->reason, akick->addtime, akick->last_used);
}
source.Reply(_("All akick entries from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str());
}
else if (what.equals_ci("BADWORDS"))
{
target_ci->ClearBadWords();
for (unsigned i = 0; i < ci->GetBadWordCount(); ++i)
{
BadWord *bw = ci->GetBadWord(i);
target_ci->AddBadWord(bw->word, bw->type);
}
source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002"), channel.c_str(), target.c_str());
}
else
{
this->OnSyntaxError(source, "");
return;
}
Log(LOG_COMMAND, u, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name;
return;
}