diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-07-09 19:31:47 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-07-09 19:31:47 (GMT) |
commit | 120fc58d759630824d2e4107bf3c4f5a822999f5 (patch) | |
tree | ebff187abdbb3eb2103249636b12d45f2750269e /Swift | |
parent | d78c4858afaaf856ec95d45adf59916b6eaf032d (diff) | |
download | swift-contrib-120fc58d759630824d2e4107bf3c4f5a822999f5.zip swift-contrib-120fc58d759630824d2e4107bf3c4f5a822999f5.tar.bz2 |
Get the avatar right in the chats list more often
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 4c43a89..12fec4f 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -347,16 +347,21 @@ void ChatsManager::setAvatarManager(AvatarManager* avatarManager) { avatarManager_->onAvatarChanged.disconnect(boost::bind(&ChatsManager::handleAvatarChanged, this, _1)); } avatarManager_ = avatarManager; + foreach (ChatListWindow::Chat& chat, recentChats_) { + if (!chat.isMUC) { + chat.setAvatarPath(avatarManager_->getAvatarPath(chat.jid)); + } + } avatarManager_->onAvatarChanged.connect(boost::bind(&ChatsManager::handleAvatarChanged, this, _1)); } void ChatsManager::handleAvatarChanged(const JID& jid) { foreach (ChatListWindow::Chat& chat, recentChats_) { - if (!chat.isMUC && jid.toBare() == chat.jid.toBare()) { - chat.setAvatarPath(avatarManager_->getAvatarPath(jid)); - break; - } + if (!chat.isMUC && jid.toBare() == chat.jid.toBare()) { + chat.setAvatarPath(avatarManager_->getAvatarPath(jid)); + break; } + } } void ChatsManager::setServerDiscoInfo(boost::shared_ptr<DiscoInfo> info) { |