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


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

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


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

示例1: convertJIDtoContact

Contact::ref UserSearchController::convertJIDtoContact(const JID& jid) {
    Contact::ref contact = std::make_shared<Contact>();
    contact->jid = jid;

    // name lookup
    boost::optional<XMPPRosterItem> rosterItem = rosterController_->getItem(jid);
    if (rosterItem && !rosterItem->getName().empty()) {
        contact->name = rosterItem->getName();
    } else {
        VCard::ref vcard = vcardManager_->getVCard(jid);
        if (vcard && !vcard->getFullName().empty()) {
            contact->name = vcard->getFullName();
        } else {
            contact->name = jid.toString();
        }
    }

    // presence lookup
    Presence::ref presence = presenceOracle_->getAccountPresence(jid);
    if (presence) {
        contact->statusType = presence->getShow();
    } else {
        contact->statusType = StatusShow::None;
    }

    // avatar lookup
    contact->avatarPath = avatarManager_->getAvatarPath(jid);
    return contact;
}
开发者ID:swift,项目名称:swift,代码行数:29,代码来源:UserSearchController.cpp

示例2: setContact

void QtContactEditWindow::setContact(const JID& jid, const std::string& name, const std::vector<std::string>& groups, const std::set<std::string>& allGroups) {
	delete contactEditWidget_;
	jid_ = jid;
	jidLabel_->setText("<b>" + P2QSTRING(jid.toString()) + "</b>");

	contactEditWidget_ = new QtContactEditWidget(allGroups, this);
	groupsLayout_->addWidget(contactEditWidget_);
	contactEditWidget_->setName(name);
	contactEditWidget_->setSelectedGroups(groups);
}
开发者ID:bessey,项目名称:picnic-doc-server,代码行数:10,代码来源:QtContactEditWindow.cpp

示例3: file

boost::filesystem::path VCardFileStorage::getVCardPath(const JID& jid) const {
	try {
		std::string file(jid.toString());
		String::replaceAll(file, '/', "%2f");
		return boost::filesystem::path(vcardsPath / stringToPath(file + ".xml"));
	}
	catch (const boost::filesystem::filesystem_error& e) {
		std::cerr << "ERROR: " << e.what() << std::endl;
		return boost::filesystem::path();
	}
}
开发者ID:pedrosorren,项目名称:swift,代码行数:11,代码来源:VCardFileStorage.cpp

示例4: handleRoomsItemsResponse

static void handleRoomsItemsResponse(std::shared_ptr<DiscoItems> items, ErrorPayload::ref error) {
    if (error) {
        cout << "Error fetching list of rooms." << endl;
        return;
    }

    int roomCount = 0;
    cout << "List of rooms at " << mucJID.toString() << endl;
    for (auto&& item : items->getItems()) {
        roomCount++;
        cout << "\t" << roomCount << ". " << item.getJID().getNode() << " - " << item.getName() << std::endl;
        if (roomCount == 1) {
            roomJID = item.getJID();
        }
    }
    cout << endl;
    joinMUC();
}
开发者ID:swift,项目名称:swift,代码行数:18,代码来源:MUCListAndJoin.cpp

示例5: handleDiscoInfoReceived

void CapsManager::handleDiscoInfoReceived(const JID& from, const std::string& hash, DiscoInfo::ref discoInfo, ErrorPayload::ref error) {
    requestedDiscoInfos.erase(hash);
    if (error || !discoInfo || CapsInfoGenerator("", crypto).generateCapsInfo(*discoInfo.get()).getVersion() != hash) {
        if (warnOnInvalidHash && !error &&  discoInfo) {
            SWIFT_LOG(warning) << "Caps from " << from.toString() << " do not verify" << std::endl;
        }
        failingCaps.insert(std::make_pair(from, hash));
        std::map<std::string, std::set< std::pair<JID, std::string> > >::iterator i = fallbacks.find(hash);
        if (i != fallbacks.end() && !i->second.empty()) {
            std::pair<JID,std::string> fallbackAndNode = *i->second.begin();
            i->second.erase(i->second.begin());
            requestDiscoInfo(fallbackAndNode.first, fallbackAndNode.second, hash);
        }
        return;
    }
    fallbacks.erase(hash);
    capsStorage->setDiscoInfo(hash, discoInfo);
    onCapsAvailable(hash);
}
开发者ID:jakjothi,项目名称:swift,代码行数:19,代码来源:CapsManager.cpp

示例6: registerOutgoingSession

void JingleSessionManager::registerOutgoingSession(const JID& initiator, JingleSessionImpl::ref session) {
	sessions.insert(std::make_pair(JIDSession(initiator, session->getID()), session));
	SWIFT_LOG(debug) << "Added session " << session->getID() << " for initiator " << initiator.toString() << std::endl;
}
开发者ID:pedrosorren,项目名称:swift,代码行数:4,代码来源:JingleSessionManager.cpp

示例7: confirmContactDeletion

bool QtContactEditWindow::confirmContactDeletion(const JID& jid) {
	QMessageBox msgBox;
	msgBox.setWindowTitle(tr("Confirm contact deletion"));
	msgBox.setText(tr("Are you sure you want to delete this contact?"));
	msgBox.setInformativeText(QString(tr("This will remove the contact '%1' from all groups they may be in.")).arg(P2QSTRING(jid.toString())));
	msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
	msgBox.setDefaultButton(QMessageBox::Yes);
	return msgBox.exec() == QMessageBox::Yes;
}
开发者ID:bessey,项目名称:picnic-doc-server,代码行数:9,代码来源:QtContactEditWindow.cpp

示例8: joinMUC

static void joinMUC() {
    cout << "Joining " << roomJID.toString() << endl;

    muc = client->getMUCManager()->createMUC(roomJID);
    muc->joinAs("SwiftExample");
}
开发者ID:swift,项目名称:swift,代码行数:6,代码来源:MUCListAndJoin.cpp

示例9: hexify

std::string SOCKS5BytestreamServer::getSOCKSDestinationAddress(const std::string& id, const JID& from, const JID& to) {
	return Hexify::hexify(SHA1::getHash(createByteArray(id + from.toString() + to.toString())));
}
开发者ID:marosi,项目名称:SocialDesktopClient,代码行数:3,代码来源:SOCKS5BytestreamServer.cpp


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