diff options
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 @@ -13,2 +13,3 @@ #include <boost/archive/text_iarchive.hpp> +#include <boost/serialization/optional.hpp> #include <boost/serialization/vector.hpp> @@ -64,2 +65,4 @@ +BOOST_CLASS_VERSION(Swift::ChatListWindow::Chat, 1) + namespace boost { @@ -81,3 +84,3 @@ 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; @@ -88,2 +91,5 @@ namespace serialization { ar & chat.impromptuJIDs; + if (version > 0) { + ar & chat.password; + } } @@ -371,2 +377,3 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const std::string nick = ""; + std::string password = ""; if (controller) { @@ -378,4 +385,8 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const + 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; @@ -386,3 +397,3 @@ 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 { |
Swift