本文整理汇总了C++中CChan::SetTopicDate方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::SetTopicDate方法的具体用法?C++ CChan::SetTopicDate怎么用?C++ CChan::SetTopicDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChan
的用法示例。
在下文中一共展示了CChan::SetTopicDate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTopicMessage
bool CIRCSock::OnTopicMessage(CTopicMessage& Message) {
const CNick& Nick = Message.GetNick();
CChan* pChan = m_pNetwork->FindChan(Message.GetParam(0));
if (pChan) {
Message.SetChan(pChan);
bool bReturn = false;
IRCSOCKMODULECALL(OnTopicMessage(Message), &bReturn);
if (bReturn) return true;
pChan->SetTopicOwner(Nick.GetNick());
pChan->SetTopicDate((unsigned long)time(nullptr));
pChan->SetTopic(Message.GetTopic());
}
return (pChan && pChan->IsDetached());
}
示例2: ReadLine
//.........这里部分代码省略.........
}
break;
case 331: {
// :irc.server.com 331 yournick #chan :No topic is set.
CChan* pChan = m_pUser->FindChan(sLine.Token(3));
if (pChan) {
pChan->SetTopic("");
}
break;
}
case 332: {
// :irc.server.com 332 yournick #chan :This is a topic
CChan* pChan = m_pUser->FindChan(sLine.Token(3));
if (pChan) {
CString sTopic = sLine.Token(4, true);
sTopic.LeftChomp();
pChan->SetTopic(sTopic);
}
break;
}
case 333: {
// :irc.server.com 333 yournick #chan setternick 1112320796
CChan* pChan = m_pUser->FindChan(sLine.Token(3));
if (pChan) {
sNick = sLine.Token(4);
unsigned long ulDate = sLine.Token(5).ToULong();
pChan->SetTopicOwner(sNick);
pChan->SetTopicDate(ulDate);
}
break;
}
case 352: {
// :irc.yourserver.com 352 yournick #chan ident theirhost.com irc.theirserver.com theirnick H :0 Real Name
sServer = sLine.Token(0);
sNick = sLine.Token(7);
CString sIdent = sLine.Token(4);
CString sHost = sLine.Token(5);
sServer.LeftChomp();
if (sNick.Equals(GetNick())) {
m_Nick.SetIdent(sIdent);
m_Nick.SetHost(sHost);
}
m_pUser->SetIRCNick(m_Nick);
m_pUser->SetIRCServer(sServer);
const vector<CChan*>& vChans = m_pUser->GetChans();
for (unsigned int a = 0; a < vChans.size(); a++) {
vChans[a]->OnWho(sNick, sIdent, sHost);
}
break;
}
case 353: { // NAMES
sRest.Trim();
// Todo: allow for non @+= server msgs
示例3: ReadLine
//.........这里部分代码省略.........
}
break;
case 331: {
// :irc.server.com 331 yournick #chan :No topic is set.
CChan* pChan = m_pNetwork->FindChan(sLine.Token(3));
if (pChan) {
pChan->SetTopic("");
}
break;
}
case 332: {
// :irc.server.com 332 yournick #chan :This is a topic
CChan* pChan = m_pNetwork->FindChan(sLine.Token(3));
if (pChan) {
CString sTopic = sLine.Token(4, true);
sTopic.LeftChomp();
pChan->SetTopic(sTopic);
}
break;
}
case 333: {
// :irc.server.com 333 yournick #chan setternick 1112320796
CChan* pChan = m_pNetwork->FindChan(sLine.Token(3));
if (pChan) {
sNick = sLine.Token(4);
unsigned long ulDate = sLine.Token(5).ToULong();
pChan->SetTopicOwner(sNick);
pChan->SetTopicDate(ulDate);
}
break;
}
case 352: {
// :irc.yourserver.com 352 yournick #chan ident theirhost.com irc.theirserver.com theirnick H :0 Real Name
sServer = sLine.Token(0);
sNick = sLine.Token(7);
CString sIdent = sLine.Token(4);
CString sHost = sLine.Token(5);
sServer.LeftChomp();
if (sNick.Equals(GetNick())) {
m_Nick.SetIdent(sIdent);
m_Nick.SetHost(sHost);
}
m_pNetwork->SetIRCNick(m_Nick);
m_pNetwork->SetIRCServer(sServer);
const vector<CChan*>& vChans = m_pNetwork->GetChans();
for (unsigned int a = 0; a < vChans.size(); a++) {
vChans[a]->OnWho(sNick, sIdent, sHost);
}
break;
}
case 353: { // NAMES
sRest.Trim();
// Todo: allow for non @+= server msgs
示例4: OnNumericMessage
//.........这里部分代码省略.........
if (pChan) {
pChan->SetTopic("");
if (pChan->IsDetached()) {
return true;
}
}
break;
}
case 332: {
// :irc.server.com 332 yournick #chan :This is a topic
CChan* pChan = m_pNetwork->FindChan(Message.GetParam(1));
if (pChan) {
CString sTopic = Message.GetParam(2);
pChan->SetTopic(sTopic);
if (pChan->IsDetached()) {
return true;
}
}
break;
}
case 333: {
// :irc.server.com 333 yournick #chan setternick 1112320796
CChan* pChan = m_pNetwork->FindChan(Message.GetParam(1));
if (pChan) {
sNick = Message.GetParam(2);
unsigned long ulDate = Message.GetParam(3).ToULong();
pChan->SetTopicOwner(sNick);
pChan->SetTopicDate(ulDate);
if (pChan->IsDetached()) {
return true;
}
}
break;
}
case 352: { // WHO
// :irc.yourserver.com 352 yournick #chan ident theirhost.com irc.theirserver.com theirnick H :0 Real Name
sNick = Message.GetParam(5);
CString sChan = Message.GetParam(1);
CString sIdent = Message.GetParam(2);
CString sHost = Message.GetParam(3);
if (sNick.Equals(GetNick())) {
m_Nick.SetIdent(sIdent);
m_Nick.SetHost(sHost);
}
m_pNetwork->SetIRCNick(m_Nick);
m_pNetwork->SetIRCServer(sServer);
const vector<CChan*>& vChans = m_pNetwork->GetChans();
for (CChan* pChan : vChans) {
pChan->OnWho(sNick, sIdent, sHost);
}
CChan* pChan = m_pNetwork->FindChan(sChan);
if (pChan && pChan->IsDetached()) {
return true;