diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-06-20 11:47:21 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-06-20 14:38:58 (GMT) |
commit | 6eb30e0e1f0a8e7ee936f3c006c7f710785653df (patch) | |
tree | 1e72dd6445d7d8d4e06f71c52299260a941a5be6 /Swift/Controllers/ChatControllerBase.cpp | |
parent | 6d50c38e2bc6a17afb19effe06d2103f06c8ea1c (diff) | |
download | swift-contrib-6eb30e0e1f0a8e7ee936f3c006c7f710785653df.zip swift-contrib-6eb30e0e1f0a8e7ee936f3c006c7f710785653df.tar.bz2 |
Added vCard-based avatars support.
Diffstat (limited to 'Swift/Controllers/ChatControllerBase.cpp')
-rw-r--r-- | Swift/Controllers/ChatControllerBase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/Controllers/ChatControllerBase.cpp b/Swift/Controllers/ChatControllerBase.cpp index 0d22571..e84ee04 100644 --- a/Swift/Controllers/ChatControllerBase.cpp +++ b/Swift/Controllers/ChatControllerBase.cpp @@ -3,6 +3,7 @@ #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> +#include "Swiften/Avatars/AvatarManager.h" #include "Swiften/Client/StanzaChannel.h" #include "Swiften/Base/foreach.h" #include "Swift/Controllers/ChatWindow.h" @@ -11,7 +12,7 @@ namespace Swift { -ChatControllerBase::ChatControllerBase(StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle) : stanzaChannel_(stanzaChannel), iqRouter_(iqRouter), chatWindowFactory_(chatWindowFactory), toJID_(toJID), labelsEnabled_(false), presenceOracle_(presenceOracle) { +ChatControllerBase::ChatControllerBase(StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager) : stanzaChannel_(stanzaChannel), iqRouter_(iqRouter), chatWindowFactory_(chatWindowFactory), toJID_(toJID), labelsEnabled_(false), presenceOracle_(presenceOracle), avatarManager_(avatarManager) { chatWindow_ = chatWindowFactory_->createChatWindow(toJID); chatWindow_->onAllMessagesRead.connect(boost::bind(&ChatControllerBase::handleAllMessagesRead, this)); chatWindow_->onSendMessageRequest.connect(boost::bind(&ChatControllerBase::handleSendMessageRequest, this, _1)); @@ -130,7 +131,7 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> m boost::shared_ptr<SecurityLabel> label = message->getPayload<SecurityLabel>(); boost::optional<SecurityLabel> maybeLabel = label ? boost::optional<SecurityLabel>(*label) : boost::optional<SecurityLabel>(); JID from = message->getFrom(); - chatWindow_->addMessage(body, senderDisplayNameFromMessage(from), isIncomingMessageFromMe(message), maybeLabel); + chatWindow_->addMessage(body, senderDisplayNameFromMessage(from), isIncomingMessageFromMe(message), maybeLabel, String(avatarManager_->getAvatarPath(from).string())); } } |