本文整理汇总了C++中swift::presence::ref::getShow方法的典型用法代码示例。如果您正苦于以下问题:C++ ref::getShow方法的具体用法?C++ ref::getShow怎么用?C++ ref::getShow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类swift::presence::ref
的用法示例。
在下文中一共展示了ref::getShow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleSwiftRosterReceived
void handleSwiftRosterReceived(const std::string &user) {
Swift::PresenceOracle *oracle = m_users[user]->getPresenceOracle();
BOOST_FOREACH(const Swift::XMPPRosterItem &item, m_users[user]->getRoster()->getItems()) {
Swift::Presence::ref lastPresence = oracle->getLastPresence(item.getJID());
pbnetwork::StatusType status = lastPresence ? ((pbnetwork::StatusType) lastPresence->getShow()) : pbnetwork::STATUS_NONE;
handleBuddyChanged(user, item.getJID().toBare().toString(),
item.getName(), item.getGroups(), status);
}
}
示例2: handlePresence
void handlePresence() {
Swift::Presence::ref response = Swift::Presence::create();
response->setTo("localhost");
response->setFrom("[email protected]/resource");
response->setShow(Swift::StatusShow::Away);
injectPresence(response);
loop->processEvents();
// no presence received in server mode, just disco#info
CPPUNIT_ASSERT_EQUAL(1, (int) received.size());
CPPUNIT_ASSERT(getStanza(received[0])->getPayload<Swift::DiscoInfo>());
CPPUNIT_ASSERT(changedPresence);
CPPUNIT_ASSERT_EQUAL(Swift::StatusShow::Away, changedPresence->getShow());
}
示例3: handleSwiftPresenceChanged
void handleSwiftPresenceChanged(const std::string &user, Swift::Presence::ref presence) {
LOG4CXX_INFO(logger, user << ": " << presence->getFrom().toBare().toString() << " presence changed");
std::string message = presence->getStatus();
std::string photo = "";
boost::shared_ptr<Swift::VCardUpdate> update = presence->getPayload<Swift::VCardUpdate>();
if (update) {
photo = update->getPhotoHash();
}
boost::optional<Swift::XMPPRosterItem> item = m_users[user]->getRoster()->getItem(presence->getFrom());
if (item) {
handleBuddyChanged(user, presence->getFrom().toBare().toString(), item->getName(), item->getGroups(), (pbnetwork::StatusType) presence->getShow(), message, photo);
}
else {
std::vector<std::string> groups;
handleBuddyChanged(user, presence->getFrom().toBare().toString(), presence->getFrom().toBare(), groups, (pbnetwork::StatusType) presence->getShow(), message, photo);
}
}