00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <map>
00010
00011 #include <Swiften/JID/JID.h>
00012 #include <Swiften/Avatars/AvatarManager.h>
00013
00014 namespace Swift {
00015 class DummyAvatarManager : public AvatarManager {
00016 public:
00017 virtual boost::filesystem::path getAvatarPath(const JID& j) const {
00018 return boost::filesystem::path("/avatars") / j.toString();
00019 }
00020
00021 virtual ByteArray getAvatar(const JID& jid) const {
00022 std::map<JID, ByteArray>::const_iterator i = avatars.find(jid);
00023 if (i != avatars.end()) {
00024 return i->second;
00025 }
00026 else {
00027 return ByteArray();
00028 }
00029 }
00030
00031 std::map<JID, ByteArray> avatars;
00032 };
00033 }