本文整理汇总了C++中CClient::HasSelfMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CClient::HasSelfMessage方法的具体用法?C++ CClient::HasSelfMessage怎么用?C++ CClient::HasSelfMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClient
的用法示例。
在下文中一共展示了CClient::HasSelfMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendBuffer
void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
if (m_pNetwork && m_pNetwork->IsUserAttached()) {
// Based on CChan::SendBuffer()
if (!Buffer.IsEmpty()) {
const vector<CClient*> & vClients = m_pNetwork->GetClients();
for (CClient* pEachClient : vClients) {
CClient * pUseClient = (pClient ? pClient : pEachClient);
MCString msParams;
msParams["target"] = pUseClient->GetNick();
bool bWasPlaybackActive = pUseClient->IsPlaybackActive();
pUseClient->SetPlaybackActive(true);
bool bBatch = pUseClient->HasBatch();
CString sBatchName = m_sName.MD5();
if (bBatch) {
m_pNetwork->PutUser(":znc.in BATCH +" + sBatchName + " znc.in/playback " + m_sName, pUseClient);
}
size_t uSize = Buffer.Size();
for (size_t uIdx = 0; uIdx < uSize; uIdx++) {
const CBufLine& BufLine = Buffer.GetBufLine(uIdx);
if (!pUseClient->HasEchoMessage() && !pUseClient->HasSelfMessage()) {
CNick Sender(BufLine.GetFormat().Token(0));
if (Sender.NickEquals(pUseClient->GetNick())) {
continue;
}
}
CString sLine = BufLine.GetLine(*pUseClient, msParams);
if (bBatch) {
MCString msBatchTags = CUtils::GetMessageTags(sLine);
msBatchTags["batch"] = sBatchName;
CUtils::SetMessageTags(sLine, msBatchTags);
}
bool bContinue = false;
NETWORKMODULECALL(OnPrivBufferPlayLine2(*pUseClient, sLine, BufLine.GetTime()), m_pNetwork->GetUser(), m_pNetwork, nullptr, &bContinue);
if (bContinue) continue;
m_pNetwork->PutUser(sLine, pUseClient);
}
if (bBatch) {
m_pNetwork->PutUser(":znc.in BATCH -" + sBatchName, pUseClient);
}
pUseClient->SetPlaybackActive(bWasPlaybackActive);
if (pClient)
break;
}
}
}
}
示例2: SendBuffer
void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
if (m_pNetwork && m_pNetwork->IsUserAttached()) {
// Based on CChan::SendBuffer()
if (!Buffer.IsEmpty()) {
const vector<CClient*>& vClients = m_pNetwork->GetClients();
for (CClient* pEachClient : vClients) {
CClient* pUseClient = (pClient ? pClient : pEachClient);
MCString msParams;
msParams["target"] = pUseClient->GetNick();
bool bWasPlaybackActive = pUseClient->IsPlaybackActive();
pUseClient->SetPlaybackActive(true);
NETWORKMODULECALL(OnPrivBufferStarting(*this, *pUseClient),
m_pNetwork->GetUser(), m_pNetwork, nullptr,
NOTHING);
bool bBatch = pUseClient->HasBatch();
CString sBatchName = m_sName.MD5();
if (bBatch) {
m_pNetwork->PutUser(":znc.in BATCH +" + sBatchName +
" znc.in/playback " + m_sName,
pUseClient);
}
size_t uSize = Buffer.Size();
for (size_t uIdx = 0; uIdx < uSize; uIdx++) {
const CBufLine& BufLine = Buffer.GetBufLine(uIdx);
CMessage Message = BufLine.ToMessage(*pUseClient, msParams);
if (!pUseClient->HasEchoMessage() &&
!pUseClient->HasSelfMessage()) {
if (Message.GetNick().NickEquals(
pUseClient->GetNick())) {
continue;
}
}
Message.SetNetwork(m_pNetwork);
Message.SetClient(pUseClient);
if (bBatch) {
Message.SetTag("batch", sBatchName);
}
bool bContinue = false;
NETWORKMODULECALL(OnPrivBufferPlayMessage(Message),
m_pNetwork->GetUser(), m_pNetwork,
nullptr, &bContinue);
if (bContinue) continue;
m_pNetwork->PutUser(Message, pUseClient);
}
if (bBatch) {
m_pNetwork->PutUser(":znc.in BATCH -" + sBatchName,
pUseClient);
}
NETWORKMODULECALL(OnPrivBufferEnding(*this, *pUseClient),
m_pNetwork->GetUser(), m_pNetwork, nullptr,
NOTHING);
pUseClient->SetPlaybackActive(bWasPlaybackActive);
if (pClient) break;
}
}
}
}