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


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

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


在下文中一共展示了CChan::KeepBuffer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddBuffer

	void AddBuffer(CChan& chan, const CString &sLine)
	{
		// If they have keep buffer disabled, only add messages if no client is connected
		if (!chan.KeepBuffer() && m_pUser->IsUserAttached())
			return;
		chan.AddBuffer(sLine);
	}
开发者ID:Affix,项目名称:znc,代码行数:7,代码来源:savebuff.cpp

示例2: OnUserMsg

	virtual EModRet OnUserMsg(CString& sTarget, CString& sMessage) {
		sTarget.TrimLeft("\244");

		if (sMessage.Left(2) == "``") {
			sMessage.LeftChomp(2);
			return CONTINUE;
		}

		MCString::iterator it = FindNV(sTarget.AsLower());

		if (it != EndNV()) {
			CChan* pChan = m_pUser->FindChan(sTarget);
			if (pChan) {
				if (pChan->KeepBuffer())
					pChan->AddBuffer(":\244" + m_pUser->GetIRCNick().GetNickMask() + " PRIVMSG " + sTarget + " :" + sMessage);
				m_pUser->PutUser(":\244" + m_pUser->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;
	}
开发者ID:bpcampbe,项目名称:znc,代码行数:29,代码来源:crypt.cpp

示例3: AddBuffer

	void AddBuffer(CChan& Channel, const CString& sMessage) {
		// If they have keep buffer disabled, only add messages if no client is connected
		if (!Channel.KeepBuffer() && m_pUser->IsUserAttached())
			return;

		CString s = ":" + GetModNick() + "!" + GetModName() + "@znc.in PRIVMSG "
			+ Channel.GetName() + " :" + m_pUser->AddTimestamp(sMessage);
		Channel.AddBuffer(s);
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:9,代码来源:buffextras.cpp

示例4: Clone

void CChan::Clone(CChan& chan) {
	// We assume that m_sName and m_pNetwork are equal
	SetBufferCount(chan.GetBufferCount(), true);
	SetKeepBuffer(chan.KeepBuffer());
	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());
	}
}
开发者ID:jimloco,项目名称:znc,代码行数:21,代码来源:Chan.cpp

示例5: GetChan

	void GetChan(const CString& sLine) {
		const CString var  = sLine.Token(1).AsLower();
		CString username   = sLine.Token(2);
		CString chan = sLine.Token(3, true);

		if (var.empty()) {
			PutModule("Usage: getchan <variable> [username] <chan>");
			return;
		}
		if (chan.empty()) {
			chan = username;
			username = "";
		}
		if (username.empty()) {
			username = m_pUser->GetUserName();
		}

		CUser* user = GetUser(username);
		if (!user)
			return;

		CChan* pChan = user->FindChan(chan);
		if (!pChan) {
			PutModule("Error: Channel not found: " + chan);
			return;
		}

		if (var == "defmodes")
			PutModule("DefModes = " + pChan->GetDefaultModes());
		else if (var == "buffer")
			PutModule("Buffer = " + CString(pChan->GetBufferCount()));
		else if (var == "inconfig")
			PutModule("InConfig = " + pChan->InConfig());
		else if (var == "keepbuffer")
			PutModule("KeepBuffer = " + pChan->KeepBuffer());
		else if (var == "detached")
			PutModule("Detached = " + pChan->IsDetached());
		else
			PutModule("Error: Unknown variable");
	}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:40,代码来源:admin.cpp


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