send caps info in presences
This commit is contained in:
parent
174e3c5609
commit
d0adbddc0b
6 changed files with 17 additions and 4 deletions
|
@ -80,6 +80,8 @@ namespace Transport {
|
|||
/// \return Swift::StanzaChannel associated with this Transport::Component.
|
||||
Swift::StanzaChannel *getStanzaChannel();
|
||||
|
||||
Swift::CapsInfo &getBuddyCapsInfo();
|
||||
|
||||
/// Returns Swift::IQRouter associated with this Component.
|
||||
|
||||
/// \return Swift::IQRouter associated with this Component.
|
||||
|
|
|
@ -11,7 +11,7 @@ admin_password=test
|
|||
#cert=server.pfx #patch to PKCS#12 certificate
|
||||
#cert_password=test #password to that certificate if any
|
||||
users_per_backend=10
|
||||
backend=/home/hanzz/code/libtransport/backends/frotz/spectrum_frotz_backend
|
||||
backend=/home/hanzz/code/libtransport/backends/libpurple/spectrum_libpurple_backend
|
||||
#backend=../../backends/libircclient-qt/spectrum_libircclient-qt_backend
|
||||
#protocol=prpl-msn
|
||||
protocol=any
|
||||
|
|
|
@ -95,7 +95,8 @@ Swift::Presence::ref Buddy::generatePresenceStanza(int features, bool only_new)
|
|||
|
||||
if (presence->getType() != Swift::Presence::Unavailable) {
|
||||
// caps
|
||||
// presence->addPayload(boost::shared_ptr<Swift::Payload>(new Swift::CapsInfo (CONFIG().caps)));
|
||||
|
||||
presence->addPayload(boost::shared_ptr<Swift::Payload>(new Swift::CapsInfo(m_rosterManager->getUser()->getComponent()->getBuddyCapsInfo())));
|
||||
|
||||
// if (features & 0/*TRANSPORT_FEATURE_AVATARS*/) {
|
||||
presence->addPayload(boost::shared_ptr<Swift::Payload>(new Swift::VCardUpdate (getIconHash())));
|
||||
|
|
|
@ -75,8 +75,9 @@ void DiscoInfoResponder::setBuddyFeatures(std::list<std::string> &f) {
|
|||
}
|
||||
}
|
||||
|
||||
CapsInfoGenerator caps("");
|
||||
onBuddyCapsInfoChanged(caps.generateCapsInfo(m_buddyInfo));
|
||||
CapsInfoGenerator caps("spectrum");
|
||||
m_capsInfo = caps.generateCapsInfo(m_buddyInfo);
|
||||
onBuddyCapsInfoChanged(m_capsInfo);
|
||||
}
|
||||
|
||||
bool DiscoInfoResponder::handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::DiscoInfo> info) {
|
||||
|
|
|
@ -40,12 +40,17 @@ class DiscoInfoResponder : public Swift::GetResponder<Swift::DiscoInfo> {
|
|||
|
||||
boost::signal<void (const Swift::CapsInfo &capsInfo)> onBuddyCapsInfoChanged;
|
||||
|
||||
Swift::CapsInfo &getBuddyCapsInfo() {
|
||||
return m_capsInfo;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::DiscoInfo> payload);
|
||||
|
||||
Swift::DiscoInfo m_transportInfo;
|
||||
Swift::DiscoInfo m_buddyInfo;
|
||||
Config *m_config;
|
||||
Swift::CapsInfo m_capsInfo;
|
||||
};
|
||||
|
||||
}
|
|
@ -157,6 +157,10 @@ void Component::setTransportFeatures(std::list<std::string> &features) {
|
|||
m_discoInfoResponder->setTransportFeatures(features);
|
||||
}
|
||||
|
||||
Swift::CapsInfo &Component::getBuddyCapsInfo() {
|
||||
return m_discoInfoResponder->getBuddyCapsInfo();
|
||||
}
|
||||
|
||||
void Component::setBuddyFeatures(std::list<std::string> &features) {
|
||||
// TODO: handle caps change
|
||||
m_discoInfoResponder->setBuddyFeatures(features);
|
||||
|
|
Loading…
Add table
Reference in a new issue