本文整理汇总了C++中swift::JID::getNode方法的典型用法代码示例。如果您正苦于以下问题:C++ JID::getNode方法的具体用法?C++ JID::getNode怎么用?C++ JID::getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类swift::JID
的用法示例。
在下文中一共展示了JID::getNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JIDToLegacyName
std::string Buddy::JIDToLegacyName(const Swift::JID &jid) {
std::string name;
if (jid.getUnescapedNode() == jid.getNode()) {
name = jid.getNode();
if (name.find_last_of("%") != std::string::npos) {
name.replace(name.find_last_of("%"), 1, "@"); // OK
}
}
else {
name = jid.getUnescapedNode();
// Psi sucks...
// if (name.find_last_of("\\40") != std::string::npos) {
// name.replace(name.find_last_of("\\40"), 1, "@"); // OK
// }
}
return name;
}
示例2: handleGetRequest
bool DiscoItemsResponder::handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::DiscoItems> info) {
LOG4CXX_INFO(logger, "get request received with node " << info->getNode());
if (info->getNode() == "http://jabber.org/protocol/commands") {
sendResponse(from, id, m_commands);
}
else if (to.getNode().empty()) {
sendResponse(from, id, m_rooms);
}
else {
sendResponse(from, id, boost::shared_ptr<DiscoItems>(new DiscoItems()));
}
return true;
}
示例3: handleGetRequest
bool DiscoInfoResponder::handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::DiscoInfo> info) {
// disco#info for transport
if (to.getNode().empty()) {
// Adhoc command
if (m_commands.find(info->getNode()) != m_commands.end()) {
boost::shared_ptr<DiscoInfo> res(new DiscoInfo());
res->addFeature("http://jabber.org/protocol/commands");
res->addFeature("jabber:x:data");
res->addIdentity(DiscoInfo::Identity(m_commands[info->getNode()], "automation", "command-node"));
res->setNode(info->getNode());
sendResponse(from, to, id, res);
}
else if (info->getNode() == "http://jabber.org/protocol/commands") {
boost::shared_ptr<DiscoInfo> res(new DiscoInfo());
res->addIdentity(DiscoInfo::Identity("Commands", "automation", "command-list"));
res->setNode(info->getNode());
sendResponse(from, to, id, res);
}
else {
if (!info->getNode().empty()) {
sendError(from, id, ErrorPayload::ItemNotFound, ErrorPayload::Cancel);
return true;
}
boost::shared_ptr<DiscoInfo> res(new DiscoInfo(m_transportInfo));
res->setNode(info->getNode());
sendResponse(from, id, res);
}
}
// disco#info for room
else if (m_rooms.find(to.toBare().toString()) != m_rooms.end()) {
boost::shared_ptr<DiscoInfo> res(new DiscoInfo());
res->addIdentity(DiscoInfo::Identity(m_rooms[to.toBare().toString()], "conference", "text"));
res->addFeature("http://jabber.org/protocol/muc");
res->setNode(info->getNode());
sendResponse(from, to, id, res);
}
// disco#info for buddy
else {
boost::shared_ptr<DiscoInfo> res(new DiscoInfo(*m_buddyInfo));
res->setNode(info->getNode());
sendResponse(from, to, id, res);
}
return true;
}
示例4: buddFlagsFromJID
BuddyFlag Buddy::buddFlagsFromJID(const Swift::JID &jid) {
if (jid.getUnescapedNode() == jid.getNode()) {
return BUDDY_NO_FLAG;
}
return BUDDY_JID_ESCAPING;
}