本文整理汇总了C++中CChan::AutoClearChanBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::AutoClearChanBuffer方法的具体用法?C++ CChan::AutoClearChanBuffer怎么用?C++ CChan::AutoClearChanBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::AutoClearChanBuffer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddBuffer
void AddBuffer(CChan& chan, const CString &sLine)
{
// If they have AutoClearChanBuffer enabled, only add messages if no client is connected
if (chan.AutoClearChanBuffer() && m_pNetwork->IsUserAttached())
return;
chan.AddBuffer(sLine);
}
示例2: OnUserMsg
virtual EModRet OnUserMsg(CString& sTarget, CString& sMessage) {
sTarget.TrimLeft(NickPrefix());
if (sMessage.Left(2) == "``") {
sMessage.LeftChomp(2);
return CONTINUE;
}
MCString::iterator it = FindNV(sTarget.AsLower());
if (it != EndNV()) {
CChan* pChan = m_pNetwork->FindChan(sTarget);
if (pChan) {
if (!pChan->AutoClearChanBuffer())
pChan->AddBuffer(":" + NickPrefix() + _NAMEDFMT(m_pNetwork->GetIRCNick().GetNickMask()) + " PRIVMSG " + _NAMEDFMT(sTarget) + " :{text}", sMessage);
m_pUser->PutUser(":" + NickPrefix() + m_pNetwork->GetIRCNick().GetNickMask() + " PRIVMSG " + sTarget + " :" + sMessage, NULL, m_pClient);
}
CString sMsg = MakeIvec() + sMessage;
sMsg.Encrypt(it->second);
sMsg.Base64Encode();
sMsg = "+OK *" + sMsg;
PutIRC("PRIVMSG " + sTarget + " :" + sMsg);
return HALTCORE;
}
return CONTINUE;
}
示例3: AddBuffer
void AddBuffer(CChan& Channel, const CString& sMessage) {
// If they have AutoClearChanBuffer enabled, only add messages if no client is connected
if (Channel.AutoClearChanBuffer() && m_pNetwork->IsUserOnline())
return;
Channel.AddBuffer(":" + GetModNick() + "!" + GetModName() + "@znc.in PRIVMSG " + _NAMEDFMT(Channel.GetName()) + " :{text}", sMessage);
}
示例4: OnUserNotice
EModRet OnUserNotice(CString& sTarget, CString& sMessage) override {
sTarget.TrimPrefix(NickPrefix());
if (sMessage.TrimPrefix("``")) {
return CONTINUE;
}
MCString::iterator it = FindNV(sTarget.AsLower());
if (it != EndNV()) {
CChan* pChan = GetNetwork()->FindChan(sTarget);
CString sNickMask = GetNetwork()->GetIRCNick().GetNickMask();
if (pChan) {
if (!pChan->AutoClearChanBuffer())
pChan->AddBuffer(":" + NickPrefix() + _NAMEDFMT(sNickMask) + " NOTICE " + _NAMEDFMT(sTarget) + " :{text}", sMessage);
GetUser()->PutUser(":" + NickPrefix() + sNickMask + " NOTICE " + sTarget + " :" + sMessage, NULL, GetClient());
}
CString sMsg = MakeIvec() + sMessage;
sMsg.Encrypt(it->second);
sMsg.Base64Encode();
sMsg = "+OK *" + sMsg;
PutIRC("NOTICE " + sTarget + " :" + sMsg);
return HALTCORE;
}
return CONTINUE;
}
示例5: AddBuffer
void AddBuffer(CChan& Channel, const CString& sMessage,
const timeval* tv = nullptr,
const MCString& mssTags = MCString::EmptyMap) {
// If they have AutoClearChanBuffer enabled, only add messages if no
// client is connected
if (Channel.AutoClearChanBuffer() && GetNetwork()->IsUserOnline())
return;
Channel.AddBuffer(":" + GetModNick() + "!" + GetModName() +
"@znc.in PRIVMSG " +
_NAMEDFMT(Channel.GetName()) + " :{text}",
sMessage, tv, mssTags);
}
示例6: OnActionMessage
bool CIRCSock::OnActionMessage(CActionMessage& Message) {
bool bResult = false;
CChan* pChan = nullptr;
CString sTarget = Message.GetTarget();
if (sTarget.Equals(GetNick())) {
IRCSOCKMODULECALL(OnPrivCTCPMessage(Message), &bResult);
if (bResult) return true;
IRCSOCKMODULECALL(OnPrivActionMessage(Message), &bResult);
if (bResult) return true;
if (!m_pNetwork->IsUserOnline() ||
!m_pNetwork->GetUser()->AutoClearQueryBuffer()) {
const CNick& Nick = Message.GetNick();
CQuery* pQuery = m_pNetwork->AddQuery(Nick.GetNick());
if (pQuery) {
CActionMessage Format;
Format.Clone(Message);
Format.SetNick(_NAMEDFMT(Nick.GetNickMask()));
Format.SetTarget("{target}");
Format.SetText("{text}");
pQuery->AddBuffer(Format, Message.GetText());
}
}
} else {
pChan = m_pNetwork->FindChan(sTarget);
if (pChan) {
Message.SetChan(pChan);
FixupChanNick(Message.GetNick(), pChan);
IRCSOCKMODULECALL(OnChanCTCPMessage(Message), &bResult);
if (bResult) return true;
IRCSOCKMODULECALL(OnChanActionMessage(Message), &bResult);
if (bResult) return true;
if (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline() ||
pChan->IsDetached()) {
CActionMessage Format;
Format.Clone(Message);
Format.SetNick(_NAMEDFMT(Message.GetNick().GetNickMask()));
Format.SetTarget(_NAMEDFMT(Message.GetTarget()));
Format.SetText("{text}");
pChan->AddBuffer(Format, Message.GetText());
}
}
}
return (pChan && pChan->IsDetached());
}
示例7: OnNoticeMessage
bool CIRCSock::OnNoticeMessage(CNoticeMessage& Message) {
CString sTarget = Message.GetTarget();
bool bResult = false;
if (sTarget.Equals(GetNick())) {
IRCSOCKMODULECALL(OnPrivNoticeMessage(Message), &bResult);
if (bResult) return true;
if (!m_pNetwork->IsUserOnline()) {
// If the user is detached, add to the buffer
CNoticeMessage Format;
Format.Clone(Message);
Format.SetNick(CNick(_NAMEDFMT(Message.GetNick().GetNickMask())));
Format.SetTarget("{target}");
Format.SetText("{text}");
m_pNetwork->AddNoticeBuffer(Format, Message.GetText());
}
return false;
} else {
CChan* pChan = m_pNetwork->FindChan(sTarget);
if (pChan) {
Message.SetChan(pChan);
FixupChanNick(Message.GetNick(), pChan);
IRCSOCKMODULECALL(OnChanNoticeMessage(Message), &bResult);
if (bResult) return true;
if (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline() ||
pChan->IsDetached()) {
CNoticeMessage Format;
Format.Clone(Message);
Format.SetNick(_NAMEDFMT(Message.GetNick().GetNickMask()));
Format.SetTarget(_NAMEDFMT(Message.GetTarget()));
Format.SetText("{text}");
pChan->AddBuffer(Format, Message.GetText());
}
}
return (pChan && pChan->IsDetached());
}
}
示例8: Clone
void CChan::Clone(CChan& chan) {
// We assume that m_sName and m_pNetwork are equal
SetBufferCount(chan.GetBufferCount(), true);
SetAutoClearChanBuffer(chan.AutoClearChanBuffer());
SetKey(chan.GetKey());
SetDefaultModes(chan.GetDefaultModes());
if (IsDetached() != chan.IsDetached()) {
// Only send something if it makes sense
// (= Only detach if client is on the channel
// and only attach if we are on the channel)
if (IsOn()) {
if (IsDetached()) {
JoinUser(false, "");
} else {
DetachUser();
}
}
SetDetached(chan.IsDetached());
}
}
示例9: AddBuffer
void CClient::AddBuffer(const T& Message) {
const CString sTarget = Message.GetTarget();
T Format;
Format.Clone(Message);
Format.SetNick(CNick(_NAMEDFMT(GetNickMask())));
Format.SetTarget(_NAMEDFMT(sTarget));
Format.SetText("{text}");
CChan* pChan = m_pNetwork->FindChan(sTarget);
if (pChan) {
if (!pChan->AutoClearChanBuffer() || !m_pNetwork->IsUserOnline()) {
pChan->AddBuffer(Format, Message.GetText());
}
} else if (Message.GetType() != CMessage::Type::Notice) {
if (!m_pUser->AutoClearQueryBuffer() || !m_pNetwork->IsUserOnline()) {
CQuery* pQuery = m_pNetwork->AddQuery(sTarget);
if (pQuery) {
pQuery->AddBuffer(Format, Message.GetText());
}
}
}
}