本文整理汇总了C++中CChan::SetIsOn方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::SetIsOn方法的具体用法?C++ CChan::SetIsOn怎么用?C++ CChan::SetIsOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::SetIsOn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnJoinMessage
bool CIRCSock::OnJoinMessage(CJoinMessage& Message) {
const CNick& Nick = Message.GetNick();
CString sChan = Message.GetParam(0);
CChan* pChan = nullptr;
if (Nick.NickEquals(GetNick())) {
m_pNetwork->AddChan(sChan, false);
pChan = m_pNetwork->FindChan(sChan);
if (pChan) {
pChan->Enable();
pChan->SetIsOn(true);
PutIRC("MODE " + sChan);
}
} else {
pChan = m_pNetwork->FindChan(sChan);
}
if (pChan) {
pChan->AddNick(Nick.GetNickMask());
Message.SetChan(pChan);
IRCSOCKMODULECALL(OnJoinMessage(Message), NOTHING);
if (pChan->IsDetached()) {
return true;
}
}
return false;
}
示例2: OnKickMessage
bool CIRCSock::OnKickMessage(CKickMessage& Message) {
CString sChan = Message.GetParam(0);
CString sKickedNick = Message.GetKickedNick();
CChan* pChan = m_pNetwork->FindChan(sChan);
if (pChan) {
Message.SetChan(pChan);
IRCSOCKMODULECALL(OnKickMessage(Message), NOTHING);
// do not remove the nick till after the OnKick call, so modules
// can do Chan.FindNick or something to get more info.
pChan->RemNick(sKickedNick);
}
if (GetNick().Equals(sKickedNick) && pChan) {
pChan->SetIsOn(false);
// Don't try to rejoin!
pChan->Disable();
}
return (pChan && pChan->IsDetached());
}
示例3: ReadLine
//.........这里部分代码省略.........
}
vector<CChan*> vFoundChans;
const vector<CChan*>& vChans = m_pNetwork->GetChans();
for (unsigned int a = 0; a < vChans.size(); a++) {
CChan* pChan = vChans[a];
if (pChan->RemNick(Nick.GetNick())) {
vFoundChans.push_back(pChan);
if (!pChan->IsDetached()) {
bIsVisible = true;
}
}
}
NETWORKMODULECALL(OnQuit(Nick, sMessage, vFoundChans), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
if (!bIsVisible) {
return;
}
} else if (sCmd.Equals("JOIN")) {
CString sChan = sRest.Token(0).TrimPrefix_n();
CChan* pChan;
// Todo: use nick compare function
if (Nick.GetNick().Equals(GetNick())) {
m_pNetwork->AddChan(sChan, false);
pChan = m_pNetwork->FindChan(sChan);
if (pChan) {
pChan->ResetJoinTries();
pChan->Enable();
pChan->SetIsOn(true);
PutIRC("MODE " + sChan);
}
} else {
pChan = m_pNetwork->FindChan(sChan);
}
if (pChan) {
pChan->AddNick(Nick.GetNickMask());
NETWORKMODULECALL(OnJoin(Nick.GetNickMask(), *pChan), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
if (pChan->IsDetached()) {
return;
}
}
} else if (sCmd.Equals("PART")) {
CString sChan = sRest.Token(0).TrimPrefix_n();
CString sMsg = sRest.Token(1, true).TrimPrefix_n();
CChan* pChan = m_pNetwork->FindChan(sChan);
bool bDetached = false;
if (pChan) {
pChan->RemNick(Nick.GetNick());
NETWORKMODULECALL(OnPart(Nick.GetNickMask(), *pChan, sMsg), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
if (pChan->IsDetached())
bDetached = true;
}
// Todo: use nick compare function
if (Nick.GetNick().Equals(GetNick())) {
m_pNetwork->DelChan(sChan);
}