本文整理汇总了C++中CIRCNetwork::GetCurNick方法的典型用法代码示例。如果您正苦于以下问题:C++ CIRCNetwork::GetCurNick方法的具体用法?C++ CIRCNetwork::GetCurNick怎么用?C++ CIRCNetwork::GetCurNick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIRCNetwork
的用法示例。
在下文中一共展示了CIRCNetwork::GetCurNick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnUserRaw
EModRet OnUserRaw(CString& sLine) override {
// Handle ISON
if (sLine.Token(0).Equals("ison")) {
VCString vsNicks;
// Get the list of nicks which are being asked for
sLine.Token(1, true).TrimLeft_n(":").Split(" ", vsNicks, false);
CString sBNCNicks;
for (const CString& sNick : vsNicks) {
if (IsOnlineModNick(sNick)) {
sBNCNicks += " " + sNick;
}
}
// Remove the leading space
sBNCNicks.LeftChomp();
if (!GetNetwork()->GetIRCSock()) {
// if we are not connected to any IRC server, send
// an empty or module-nick filled response.
PutUser(":irc.znc.in 303 " + GetClient()->GetNick() + " :" +
sBNCNicks);
} else {
// We let the server handle this request and then act on
// the 303 response from the IRC server.
m_ISONRequests.push_back(sBNCNicks);
}
}
// Handle WHOIS
if (sLine.Token(0).Equals("whois")) {
CString sNick = sLine.Token(1);
if (IsOnlineModNick(sNick)) {
CIRCNetwork* pNetwork = GetNetwork();
PutUser(":znc.in 311 " + pNetwork->GetCurNick() + " " + sNick +
" znc znc.in * :" + sNick);
PutUser(":znc.in 312 " + pNetwork->GetCurNick() + " " + sNick +
" *.znc.in :Bouncer");
PutUser(":znc.in 318 " + pNetwork->GetCurNick() + " " + sNick +
" :End of /WHOIS list.");
return HALT;
}
}
return CONTINUE;
}
示例2: OnUserMsg
/* msgs */
CModule::EModRet CLogMod::OnUserMsg(CString& sTarget, CString& sMessage) {
CIRCNetwork* pNetwork = GetNetwork();
if (pNetwork) {
PutLog("<" + pNetwork->GetCurNick() + "> " + sMessage, sTarget);
}
return CONTINUE;
}