diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-09-25 14:06:35 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2015-09-25 14:06:35 (GMT) |
| commit | 37aafcb4d693a0b4f5944a52e0c070e5aa384245 (patch) | |
| tree | f6fe68c584de96992c2d2fde1f3cc7c3d702e084 /Swiften/VCards/VCardManager.cpp | |
| parent | 2609a8a63662dfea9dccce2fd135b11a8d6c7875 (diff) | |
| download | swift-37aafcb4d693a0b4f5944a52e0c070e5aa384245.zip swift-37aafcb4d693a0b4f5944a52e0c070e5aa384245.tar.bz2 | |
Do not flush vCard cache if IQ request returns an error
Test-Information:
Adjusted the corresponding test case accordingly.
Change-Id: I4626f09cd51bac2ff9ca97d5a7da5a173fc627a5
Diffstat (limited to 'Swiften/VCards/VCardManager.cpp')
| -rw-r--r-- | Swiften/VCards/VCardManager.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Swiften/VCards/VCardManager.cpp b/Swiften/VCards/VCardManager.cpp index 5e552d6..5fa44ae 100644 --- a/Swiften/VCards/VCardManager.cpp +++ b/Swiften/VCards/VCardManager.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2014 Isode Limited. | 2 | * Copyright (c) 2010-2015 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -10,9 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | #include <Swiften/Base/Log.h> | 11 | #include <Swiften/Base/Log.h> |
| 12 | #include <Swiften/JID/JID.h> | 12 | #include <Swiften/JID/JID.h> |
| 13 | #include <Swiften/VCards/VCardStorage.h> | ||
| 14 | #include <Swiften/VCards/GetVCardRequest.h> | 13 | #include <Swiften/VCards/GetVCardRequest.h> |
| 15 | 14 | #include <Swiften/VCards/VCardStorage.h> | |
| 16 | 15 | ||
| 17 | namespace Swift { | 16 | namespace Swift { |
| 18 | 17 | ||
| @@ -53,12 +52,14 @@ void VCardManager::requestOwnVCard() { | |||
| 53 | 52 | ||
| 54 | 53 | ||
| 55 | void VCardManager::handleVCardReceived(const JID& actualJID, VCard::ref vcard, ErrorPayload::ref error) { | 54 | void VCardManager::handleVCardReceived(const JID& actualJID, VCard::ref vcard, ErrorPayload::ref error) { |
| 56 | if (error || !vcard) { | ||
| 57 | vcard = VCard::ref(new VCard()); | ||
| 58 | } | ||
| 59 | requestedVCards.erase(actualJID); | 55 | requestedVCards.erase(actualJID); |
| 60 | JID jid = actualJID.isValid() ? actualJID : ownJID.toBare(); | 56 | if (!error) { |
| 61 | setVCard(jid, vcard); | 57 | if (!vcard) { |
| 58 | vcard = VCard::ref(new VCard()); | ||
| 59 | } | ||
| 60 | JID jid = actualJID.isValid() ? actualJID : ownJID.toBare(); | ||
| 61 | setVCard(jid, vcard); | ||
| 62 | } | ||
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | SetVCardRequest::ref VCardManager::createSetVCardRequest(VCard::ref vcard) { | 65 | SetVCardRequest::ref VCardManager::createSetVCardRequest(VCard::ref vcard) { |
Swift