diff options
Diffstat (limited to 'Swift/Controllers/MainController.cpp')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index d9e177b..c4ed28e 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -561,9 +561,12 @@ void MainController::handleVCardReceived(const JID& jid, VCard::ref vCard) { if (!jid.equals(jid_, JID::WithoutResource) || !vCard || vCard->getPhoto().isEmpty()) { return; } - vCardPhotoHash_ = Hexify::hexify(SHA1::getHash(vCard->getPhoto())); - if (client_ && client_->isAvailable()) { - sendPresence(statusTracker_->getNextPresence()); + std::string hash = Hexify::hexify(SHA1::getHash(vCard->getPhoto())); + if (hash != vCardPhotoHash_) { + vCardPhotoHash_ = hash; + if (client_ && client_->isAvailable()) { + sendPresence(statusTracker_->getNextPresence()); + } } } |