diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-08-28 14:39:42 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-08-28 14:39:42 (GMT) |
commit | eba9a50f10082430c38b849b6af95f92f3de6ef8 (patch) | |
tree | 709d1912d8304893066518525101c1e93598d0d2 /Swiften | |
parent | c6d782ee1c904330b82e3e1ce2b90baf49ead4de (diff) | |
download | swift-eba9a50f10082430c38b849b6af95f92f3de6ef8.zip swift-eba9a50f10082430c38b849b6af95f92f3de6ef8.tar.bz2 |
Keep VCard photo hash cache consistent.
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/VCards/VCardFileStorage.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Swiften/VCards/VCardFileStorage.cpp b/Swiften/VCards/VCardFileStorage.cpp index cd5cc9c..476fde1 100644 --- a/Swiften/VCards/VCardFileStorage.cpp +++ b/Swiften/VCards/VCardFileStorage.cpp @@ -48,6 +48,7 @@ VCardFileStorage::VCardFileStorage(boost::filesystem::path dir) : vcardsPath(dir } boost::shared_ptr<VCard> VCardFileStorage::getVCard(const JID& jid) const { + boost::shared_ptr<VCard> result; try { boost::filesystem::path vcardPath(getVCardPath(jid)); if (boost::filesystem::exists(vcardPath)) { @@ -57,16 +58,14 @@ boost::shared_ptr<VCard> VCardFileStorage::getVCard(const JID& jid) const { VCardParser parser; PayloadParserTester tester(&parser); tester.parse(data.toString()); - return boost::dynamic_pointer_cast<VCard>(parser.getPayload()); - } - else { - return boost::shared_ptr<VCard>(); + result = boost::dynamic_pointer_cast<VCard>(parser.getPayload()); } } catch (const boost::filesystem::filesystem_error& e) { std::cerr << "ERROR: " << e.what() << std::endl; - return boost::shared_ptr<VCard>(); } + getAndUpdatePhotoHash(jid, result); + return result; } void VCardFileStorage::setVCard(const JID& jid, VCard::ref v) { |