diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-03-11 23:04:47 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-03-11 23:04:47 (GMT) |
commit | 3a39980d887a874e571d59ac0cebda103300c3a5 (patch) | |
tree | 9135075403ac35d39b9f638c4a1914177ff3c525 /Swift/Controllers | |
parent | 1e63ca24edf35e5681653189fd6ca107627946f4 (diff) | |
download | swift-3a39980d887a874e571d59ac0cebda103300c3a5.zip swift-3a39980d887a874e571d59ac0cebda103300c3a5.tar.bz2 |
Fixed unnecessary updating and sending out VCard photo hash.
Diffstat (limited to 'Swift/Controllers')
-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()); + } } } |