diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-05-06 13:08:57 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-05-29 16:18:23 (GMT) |
commit | b70a50f11da1ea57a0e89ff14882eed03944eb2a (patch) | |
tree | bbe3d3f28104dcba7d276a7016da283665b8f326 /Swift/Controllers/Chat/ChatsManager.cpp | |
parent | ab612d0f18ff545b4ebcb2bf2bb400996e751181 (diff) | |
download | swift-contrib-b70a50f11da1ea57a0e89ff14882eed03944eb2a.zip swift-contrib-b70a50f11da1ea57a0e89ff14882eed03944eb2a.tar.bz2 |
Right-click MUC in Recents to bookmark.
Change-Id: Idfb5907adf9bf53f0ac1f417dd57d49ecc897bb0
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 654f735..1698b4a 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -12,4 +12,5 @@ #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> +#include <boost/serialization/optional.hpp> #include <boost/serialization/vector.hpp> #include <boost/serialization/map.hpp> @@ -63,4 +64,6 @@ #include <Swiften/Base/Log.h> +BOOST_CLASS_VERSION(Swift::ChatListWindow::Chat, 1) + namespace boost { namespace serialization { @@ -80,5 +83,5 @@ namespace serialization { } - template<class Archive> void serialize(Archive& ar, Swift::ChatListWindow::Chat& chat, const unsigned int /*version*/) { + template<class Archive> void serialize(Archive& ar, Swift::ChatListWindow::Chat& chat, const unsigned int version) { ar & chat.jid; ar & chat.chatName; @@ -87,4 +90,7 @@ namespace serialization { ar & chat.nick; ar & chat.impromptuJIDs; + if (version > 0) { + ar & chat.password; + } } } @@ -370,4 +376,5 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const StatusShow::Type type = StatusShow::None; std::string nick = ""; + std::string password = ""; if (controller) { unreadCount = controller->getUnreadCount(); @@ -377,6 +384,10 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const nick = controller->getNick(); + if (controller->getPassword()) { + password = *controller->getPassword(); + } + if (controller->isImpromptu()) { - ChatListWindow::Chat chat = ChatListWindow::Chat(jid, jid.toString(), activity, unreadCount, type, boost::filesystem::path(), true, nick); + ChatListWindow::Chat chat = ChatListWindow::Chat(jid, jid.toString(), activity, unreadCount, type, boost::filesystem::path(), true, nick, password); typedef std::pair<std::string, JID> StringJIDPair; std::map<std::string, JID> participants = controller->getParticipantJIDs(); @@ -385,5 +396,5 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const } } - return ChatListWindow::Chat(jid, jid.toString(), activity, unreadCount, type, boost::filesystem::path(), true, nick); + return ChatListWindow::Chat(jid, jid.toString(), activity, unreadCount, type, boost::filesystem::path(), true, nick, password); } else { ChatController* controller = getChatControllerIfExists(jid, false); |