summaryrefslogtreecommitdiffstats
path: root/src/account-server/dalstorage.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-02-27 16:39:07 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-02-27 16:39:07 +0000
commitea7d7df0e8b9e6c148ea9dfb8a56e113b50e008d (patch)
treee30ee08b4ff4659205d0bcbb1ab2b3db5f71f650 /src/account-server/dalstorage.cpp
parent8bbaf323aef0c4f124b1a35680c323f833d2d58f (diff)
Implementation of chat channels by Trapdoor.
Diffstat (limited to 'src/account-server/dalstorage.cpp')
-rw-r--r--src/account-server/dalstorage.cpp11
1 files changed, 7 insertions, 4 deletions
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<short> toShort;
+ string_to<bool> toBool;
// The formatted datas
std::map<short, ChatChannel> 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<short, ChatChannel>& 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());