diff options
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