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


C++ JID::equals方法代码示例

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


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

示例1: isCorrectSender

bool Request::isCorrectSender(const JID& jid) {
	if (router_->isAccountJID(receiver_)) {
		if (jid.isValid() && jid.equals(router_->getJID(), JID::WithResource)) {
			// This unspecified behavior seems to happen in ejabberd versions (e.g. 2.0.5)
			SWIFT_LOG(warning) << "Server responded to an account request with a full JID, which is not allowed. Handling it anyway.";
			return true;
		}
		return router_->isAccountJID(jid);
	}
	else {
		return jid.equals(receiver_, JID::WithResource);
	}
}
开发者ID:pedrosorren,项目名称:swift,代码行数:13,代码来源:Request.cpp

示例2: requestVCard

void VCardManager::requestVCard(const JID& requestedJID) {
	JID jid = requestedJID.equals(ownJID, JID::WithoutResource) ? JID() : requestedJID;
	if (requestedVCards.find(jid) != requestedVCards.end()) {
		return;
	}
	GetVCardRequest::ref request = GetVCardRequest::create(jid, iqRouter);
	request->onResponse.connect(boost::bind(&VCardManager::handleVCardReceived, this, jid, _1, _2));
	request->send();
	requestedVCards.insert(jid);
}
开发者ID:scopeInfinity,项目名称:swift,代码行数:10,代码来源:VCardManager.cpp

示例3: handleVCardReceived

void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) {
	if (!jid.equals(jid_, JID::WithoutResource) || !vCard || vCard->getPhoto().isEmpty()) {
		return;
	}
	std::string hash = Hexify::hexify(SHA1::getHash(vCard->getPhoto()));
	if (hash != vCardPhotoHash_) {
		vCardPhotoHash_ = hash;
		if (client_ && client_->isAvailable()) {
			sendPresence(statusTracker_->getNextPresence());
		}
	}
}
开发者ID:bessey,项目名称:picnic-doc-server,代码行数:12,代码来源:MainController.cpp

示例4: handleVCardReceived

void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) {
	if (!jid.equals(jid_, JID::WithoutResource) || !vCard) {
		return;
	}
	std::string hash;
	if (!vCard->getPhoto().empty()) {
		hash = Hexify::hexify(networkFactories_->getCryptoProvider()->getSHA1Hash(vCard->getPhoto()));
	}
	if (hash != vCardPhotoHash_) {
		vCardPhotoHash_ = hash;
		if (client_ && client_->isAvailable()) {
			sendPresence(statusTracker_->getNextPresence());
		}
	}
}
开发者ID:scopeInfinity,项目名称:swift,代码行数:15,代码来源:MainController.cpp


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