本文整理汇总了C++中chanserv::Channel::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::Delete方法的具体用法?C++ Channel::Delete怎么用?C++ Channel::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chanserv::Channel
的用法示例。
在下文中一共展示了Channel::Delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
{
const Anope::string &chan = params[0];
if (Anope::ReadOnly && !source.HasPriv("chanserv/administration"))
{
source.Reply(_("Sorry, channel de-registration is temporarily disabled."));
return;
}
ChanServ::Channel *ci = ChanServ::Find(chan);
if (ci == NULL)
{
source.Reply(_("Channel \002{0}\002 isn't registered."), chan);
return;
}
if (params.size() < 2 || !chan.equals_ci(params[1]))
{
source.Reply(_("You must enter the channel name twice as a confirmation that you wish to drop \002{0}\002."), ci->GetName());
return;
}
if ((ci->HasFieldS("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && !source.HasCommand("chanserv/drop"))
{
source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->GetName());
return;
}
EventReturn MOD_RESULT = this->onchandrop(&Event::ChanDrop::OnChanDrop, source, ci);
if (MOD_RESULT == EVENT_STOP)
return;
bool override = (ci->HasFieldS("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"));
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "(founder was: " << (ci->GetFounder() ? ci->GetFounder()->GetDisplay() : "none") << ")";
Reference<Channel> c = ci->c;
ci->Delete();
source.Reply(_("Channel \002{0}\002 has been dropped."), chan);
if (c)
c->CheckModes();
}