当前位置: 首页>>代码示例>>C++>>正文


C++ CChan::SetTopicOwner方法代码示例

本文整理汇总了C++中CChan::SetTopicOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ CChan::SetTopicOwner方法的具体用法?C++ CChan::SetTopicOwner怎么用?C++ CChan::SetTopicOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CChan的用法示例。


在下文中一共展示了CChan::SetTopicOwner方法的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());
}
开发者ID:fnordcordia,项目名称:znc,代码行数:17,代码来源:IRCSock.cpp

示例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();
开发者ID:stevestreza,项目名称:ZNC-Node,代码行数:67,代码来源:IRCSock.cpp

示例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();
开发者ID:jimloco,项目名称:znc,代码行数:67,代码来源:IRCSock.cpp

示例4: OnNumericMessage


//.........这里部分代码省略.........
        CChan* pChan = m_pNetwork->FindChan(Message.GetParam(1));

        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()) {
开发者ID:fnordcordia,项目名称:znc,代码行数:67,代码来源:IRCSock.cpp


注:本文中的CChan::SetTopicOwner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。