diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-03-28 13:25:13 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-03-28 13:25:35 (GMT) |
commit | a59af6c6daa72dd491189335cf2d255a788eb0f6 (patch) | |
tree | a09c9b67e6ba5ea0ac87ab06a0b9836d61571a3e /Swiften/Avatars | |
parent | 625d6a9f18c2377cdc3180e74b773ce3cbb2dcba (diff) | |
download | swift-contrib-a59af6c6daa72dd491189335cf2d255a788eb0f6.zip swift-contrib-a59af6c6daa72dd491189335cf2d255a788eb0f6.tar.bz2 |
Chat list in the gui (mostly non-functional).
Diffstat (limited to 'Swiften/Avatars')
-rw-r--r-- | Swiften/Avatars/AvatarManager.cpp | 6 | ||||
-rw-r--r-- | Swiften/Avatars/AvatarManager.h | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Swiften/Avatars/AvatarManager.cpp b/Swiften/Avatars/AvatarManager.cpp index 42451af..3825ffd 100644 --- a/Swiften/Avatars/AvatarManager.cpp +++ b/Swiften/Avatars/AvatarManager.cpp @@ -27,6 +27,10 @@ AvatarManager::~AvatarManager() { } +void AvatarManager::setMUCRegistry(MUCRegistry* mucRegistry) { + mucRegistry_ = mucRegistry; +} + void AvatarManager::handlePresenceReceived(boost::shared_ptr<Presence> presence) { boost::shared_ptr<VCardUpdate> update = presence->getPayload<VCardUpdate>(); if (!update) { @@ -97,7 +101,7 @@ boost::filesystem::path AvatarManager::getAvatarPath(const JID& jid) const { JID AvatarManager::getAvatarJID(const JID& jid) const { JID bareFrom = jid.toBare(); - return (mucRegistry_->isMUC(bareFrom) ? jid : bareFrom); + return (mucRegistry_ && mucRegistry_->isMUC(bareFrom)) ? jid : bareFrom; } diff --git a/Swiften/Avatars/AvatarManager.h b/Swiften/Avatars/AvatarManager.h index 448526e..fd308d9 100644 --- a/Swiften/Avatars/AvatarManager.h +++ b/Swiften/Avatars/AvatarManager.h @@ -19,9 +19,11 @@ namespace Swift { class AvatarManager { public: - AvatarManager(StanzaChannel*, IQRouter*, AvatarStorage*, MUCRegistry*); + AvatarManager(StanzaChannel*, IQRouter*, AvatarStorage*, MUCRegistry* = NULL); virtual ~AvatarManager(); + virtual void setMUCRegistry(MUCRegistry*); + virtual String getAvatarHash(const JID&) const; virtual boost::filesystem::path getAvatarPath(const JID&) const; virtual void setAvatar(const JID&, const ByteArray& avatar); |