From ea7d7df0e8b9e6c148ea9dfb8a56e113b50e008d Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Tue, 27 Feb 2007 16:39:07 +0000 Subject: Implementation of chat channels by Trapdoor. --- src/account-server/dalstorage.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/account-server/dalstorage.cpp') diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp index 5cc8dd0..4b1e7ea 100644 --- a/src/account-server/dalstorage.cpp +++ b/src/account-server/dalstorage.cpp @@ -525,13 +525,14 @@ DALStorage::getChannelList() // specialize the string_to functor to convert // a string to a short. string_to toShort; + string_to toBool; // The formatted datas std::map channels; try { std::stringstream sql; - sql << "select id, name, announcement, password from "; + sql << "select id, name, announcement, password, privacy from "; sql << CHANNELS_TBL_NAME; sql << ";"; @@ -547,7 +548,8 @@ DALStorage::getChannelList() channels.insert(std::make_pair(toShort(channelInfo(i,0)), ChatChannel(channelInfo(i,1), channelInfo(i,2), - channelInfo(i,3)))); + channelInfo(i,3), + toBool(channelInfo(i,4))))); LOG_DEBUG("Channel (" << channelInfo(i,0) << ") loaded: " << channelInfo(i,1) << ": " << channelInfo(i,2)); @@ -593,12 +595,13 @@ DALStorage::updateChannels(std::map& channelList) sql.str(""); sql << "insert into " << CHANNELS_TBL_NAME - << " (id, name, announcement, password)" + << " (id, name, announcement, password, privacy)" << " values (" << i->first << ", \"" << i->second.getName() << "\", \"" << i->second.getAnnouncement() << "\", \"" - << i->second.getPassword() << "\");"; + << i->second.getPassword() << "\", \"" + << i->second.getPrivacy() << "\");"; LOG_DEBUG("Channel (" << i->first << ") saved: " << i->second.getName() << ": " << i->second.getAnnouncement()); -- cgit