本文整理汇总了C++中ChannelInfo::WhoSends方法的典型用法代码示例。如果您正苦于以下问题:C++ ChannelInfo::WhoSends方法的具体用法?C++ ChannelInfo::WhoSends怎么用?C++ ChannelInfo::WhoSends使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChannelInfo
的用法示例。
在下文中一共展示了ChannelInfo::WhoSends方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms)
{
const Anope::string &chan = params[0];
User *u = source.u;
Channel *c = findchan(chan);
if (!c)
{
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
return;
}
ChannelInfo *ci = c->ci;
if (!ci)
{
source.Reply(CHAN_X_NOT_REGISTERED, chan.c_str());
return;
}
if (!ci->AccessFor(u).HasPriv("INVITE") && !u->HasCommand("chanserv/invite"))
{
source.Reply(ACCESS_DENIED);
return;
}
User *u2;
if (params.size() == 1)
u2 = u;
else
{
if (!(u2 = finduser(params[1])))
{
source.Reply(NICK_X_NOT_IN_USE, params[1].c_str());
return;
}
}
if (c->FindUser(u2))
{
if (u2 == u)
source.Reply(_("You are already in \002%s\002!"), c->name.c_str());
else
source.Reply(_("\002%s\002 is already in \002%s\002!"), u2->nick.c_str(), c->name.c_str());
}
else
{
bool override = !ci->AccessFor(u).HasPriv("INVITE");
ircdproto->SendInvite(ci->WhoSends(), chan, u2->nick);
if (u2 != u)
{
source.Reply(_("\002%s\002 has been invited to \002%s\002."), u2->nick.c_str(), c->name.c_str());
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << u2->nick;
}
else
{