本文整理汇总了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);
}
}
示例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);
}
示例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());
}
}
}
示例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());
}
}
}