diff options
-rw-r--r-- | Swift/Controllers/MainController.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 45a0df7..df137f4 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -469,7 +469,5 @@ void MainController::sendPresence(boost::shared_ptr<Presence> presence) { // Add information and send - if (!vCardPhotoHash_.empty()) { presence->updatePayload(boost::make_shared<VCardUpdate>(vCardPhotoHash_)); - } client_->getPresenceSender()->sendPresence(presence); if (presence->getType() == Presence::Unavailable) { @@ -769,8 +767,11 @@ void MainController::handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) { - if (!jid.equals(jid_, JID::WithoutResource) || !vCard || vCard->getPhoto().empty()) { + if (!jid.equals(jid_, JID::WithoutResource) || !vCard) { return; } - std::string hash = Hexify::hexify(networkFactories_->getCryptoProvider()->getSHA1Hash(vCard->getPhoto())); + std::string hash; + if (!vCard->getPhoto().empty()) { + hash = Hexify::hexify(networkFactories_->getCryptoProvider()->getSHA1Hash(vCard->getPhoto())); + } if (hash != vCardPhotoHash_) { vCardPhotoHash_ = hash; |