本文整理汇总了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;
}
示例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);
}
示例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();
}
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例8: joinMUC
static void joinMUC() {
cout << "Joining " << roomJID.toString() << endl;
muc = client->getMUCManager()->createMUC(roomJID);
muc->joinAs("SwiftExample");
}
示例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())));
}