本文整理汇总了C++中Channel::ChangeTopicInternal方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::ChangeTopicInternal方法的具体用法?C++ Channel::ChangeTopicInternal怎么用?C++ Channel::ChangeTopicInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::ChangeTopicInternal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
/*
* CHANINFO is used by servers to inform each other about a channel: its
* modes, channel key, user limits and its topic. The parameter combination
* <key> and <limit> is optional, as well as the <topic> parameter, so that
* there are three possible forms of this command:
*
* CHANINFO <chan> +<modes>
* CHANINFO <chan> +<modes> :<topic>
* CHANINFO <chan> +<modes> <key> <limit> :<topic>
*
* The parameter <key> must be ignored if a channel has no key (the parameter
* <modes> doesn't list the "k" channel mode). In this case <key> should
* contain "*" because the parameter <key> is required by the CHANINFO syntax
* and therefore can't be omitted. The parameter <limit> must be ignored when
* a channel has no user limit (the parameter <modes> doesn't list the "l"
* channel mode). In this case <limit> should be "0".
*/
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override
{
bool created;
Channel *c = Channel::FindOrCreate(params[0], created);
Anope::string modes = params[1];
if (params.size() == 3)
{
c->ChangeTopicInternal(NULL, source.GetName(), params[2], Anope::CurTime);
}
else if (params.size() == 5)
{
for (size_t i = 0, end = params[1].length(); i < end; ++i)
{
switch(params[1][i])
{
case 'k':
modes += " " + params[2];
continue;
case 'l':
modes += " " + params[3];
continue;
}
}
c->ChangeTopicInternal(NULL, source.GetName(), params[4], Anope::CurTime);
}
c->SetModesInternal(source, modes);
}
示例2: Run
void Topic::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
Channel *c = Channel::Find(params[0]);
if (c)
c->ChangeTopicInternal(source.GetUser(), source.GetSource(), params[1], Anope::CurTime);
return;
}
示例3:
void hybrid::TBurst::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
Anope::string setter;
sepstream(params[3], '!').GetToken(setter, 0);
time_t topic_time = Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime;
Channel *c = Channel::Find(params[1]);
if (c)
c->ChangeTopicInternal(NULL, setter, params[4], topic_time);
}
示例4:
/*
* params[0] = channel
* params[1] = ts
* params[2] = topic OR who set the topic
* params[3] = topic if params[2] isn't the topic
*/
void ratbox::TB::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
time_t topic_time = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : Anope::CurTime;
Channel *c = Channel::Find(params[0]);
if (!c)
return;
const Anope::string &setter = params.size() == 4 ? params[2] : "",
topic = params.size() == 4 ? params[3] : params[2];
c->ChangeTopicInternal(NULL, setter, topic, topic_time);
}
示例5: OnTopic
bool OnTopic(const Anope::string &, const std::vector<Anope::string> ¶ms)
{
if (params.size() < 4)
return true;
Channel *c = findchan(params[0]);
if (!c)
{
Log() << "TOPIC for nonexistant channel " << params[0];
return true;
}
c->ChangeTopicInternal(params[1], params[3], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime);
return true;
}