diff --git a/include/transport/buddy.h b/include/transport/buddy.h index c52f30fc4953825848b4b95ecf74861c3124c331..47a3baf702816c117acdcadb4ccd566a474fae7f 100644 --- a/include/transport/buddy.h +++ b/include/transport/buddy.h @@ -105,6 +105,10 @@ class Buddy { void buddyChanged(); + void handleVCardReceived(const std::string &id, const Swift::JID &to, Swift::VCard::ref vcard); + + virtual void getVCard(const std::string &id, const Swift::JID &to) = 0; + /// Returns legacy network username of this buddy. (for example UIN for ICQ, /// JID for Jabber, ...). /// \return legacy network username diff --git a/spectrum/src/spectrumbuddy.cpp b/spectrum/src/spectrumbuddy.cpp index d3eab0a9eac04f6eadb2b7bb62b90f3f42b71c44..c89602f1f00de6b9b4b4ef38df90fafacd6e5d0f 100644 --- a/spectrum/src/spectrumbuddy.cpp +++ b/spectrum/src/spectrumbuddy.cpp @@ -132,3 +132,7 @@ std::vector SpectrumBuddy::getGroups() { return groups; } +void SpectrumBuddy::getVCard(const std::string &id, const Swift::JID &to) { + +} + diff --git a/spectrum/src/spectrumbuddy.h b/spectrum/src/spectrumbuddy.h index 0ee6c349575e3741853db88fb60a379761175716..214716f89676660cd926f8ce8515f1c5ef53c68e 100644 --- a/spectrum/src/spectrumbuddy.h +++ b/spectrum/src/spectrumbuddy.h @@ -46,6 +46,7 @@ class SpectrumBuddy : public Buddy { void addBuddy(PurpleBuddy *buddy) { m_buddies.push_back(buddy); } void removeBuddy(PurpleBuddy *buddy) { m_buddies.remove(buddy); } int getBuddiesCount() { return m_buddies.size(); } + void getVCard(const std::string &id, const Swift::JID &to); PurpleBuddy *getBuddy() { return m_buddy; } diff --git a/src/buddy.cpp b/src/buddy.cpp index 98e43e22688a3bb9c216253b7f62e8d1895ca5cd..5dac52b4f3d59b8e052ab70ee31ebaf011e383f8 100644 --- a/src/buddy.cpp +++ b/src/buddy.cpp @@ -153,6 +153,11 @@ void Buddy::buddyChanged() { } } +void Buddy::handleVCardReceived(const std::string &id, const Swift::JID &to, Swift::VCard::ref vcard) { + boost::shared_ptr > request(new Swift::GenericRequest(Swift::IQ::Result, m_rosterManager->getUser()->getJID(), vcard, m_rosterManager->getUser()->getComponent()->getIQRouter())); + request->send(); +} + std::string Buddy::JIDToLegacyName(const Swift::JID &jid) { std::string name; if (jid.getUnescapedNode() == jid.getNode()) {