00001
00002
00003
00004
00005
00006
00007 #include <map>
00008 #include <boost/shared_ptr.hpp>
00009 #include <string>
00010
00011 #include <Swiften/Base/API.h>
00012 #include <Swiften/Base/boost_bsignals.h>
00013 #include <Swiften/JID/JID.h>
00014 #include <Swiften/Elements/VCard.h>
00015
00016 namespace Swift {
00017 class XMPPRoster;
00018 class MUCRegistry;
00019 class VCardManager;
00020
00021 class SWIFTEN_API NickResolver {
00022 public:
00023 NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManager* vcardManager, MUCRegistry* mucRegistry);
00024
00025 std::string jidToNick(const JID& jid);
00026
00027 boost::signal<void (const JID&, const std::string& )> onNickChanged;
00028
00029 private:
00030 void handleVCardReceived(const JID& jid, VCard::ref vCard);
00031 void handleJIDUpdated(const JID& jid, const std::string& previousNick, const std::vector<std::string>& groups);
00032 void handleJIDAdded(const JID& jid);
00033
00034 private:
00035 JID ownJID_;
00036 std::string ownNick_;
00037 XMPPRoster* xmppRoster_;
00038 MUCRegistry* mucRegistry_;
00039 VCardManager* vcardManager_;
00040 };
00041 }
00042