diff options
Diffstat (limited to 'src/modules/UserListManager/RequestHandlers/UserListDiffUploadRequestHandler.cpp')
-rw-r--r-- | src/modules/UserListManager/RequestHandlers/UserListDiffUploadRequestHandler.cpp | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/modules/UserListManager/RequestHandlers/UserListDiffUploadRequestHandler.cpp b/src/modules/UserListManager/RequestHandlers/UserListDiffUploadRequestHandler.cpp deleted file mode 100644 index 4660850..0000000 --- a/src/modules/UserListManager/RequestHandlers/UserListDiffUploadRequestHandler.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * UserListDiffUploadRequestHandler.cpp - * - * Copyright (C) 2009 Matthias Schiffer <matthias@gamezock.de> - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "UserListDiffUploadRequestHandler.h" -#include "../UserListManager.h" -#include "../Util.h" - -#include <boost/date_time/posix_time/posix_time.hpp> - -namespace Mad { -namespace Modules { -namespace UserListManager { -namespace RequestHandlers { - -void UserListDiffUploadRequestHandler::handlePacket(boost::shared_ptr<const Common::XmlData> packet) { - if(packet->getType() == "Cancel") { - Common::XmlData ret; - ret.setType("OK"); - sendPacket(ret); - - signalFinished(); - return; - } - else if(packet->getType() != "UploadUserListDiff") { - getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); - - Common::XmlData ret; - ret.setType("Error"); - ret.set("ErrorCode", Core::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished(); - return; - } - - if(!getConnection()->isAuthenticated()) - throw(Core::Exception(Core::Exception::PERMISSION)); - - if(name.empty()) { // Request - name = packet->get<const std::string&>("name"); - - if(name.empty()) - name = boost::posix_time::to_simple_string(boost::posix_time::second_clock::universal_time()); - - Common::XmlData ret; - ret.setType("Continue"); - ret.set("exists", userListManager->existsUserListDiff(name)); - sendPacket(ret); - } - else { // Upload - boost::shared_ptr<UserListDiff> diff = Util::deserializeUserListDiff(packet.get()); - userListManager->storeUserListDiff(name, diff.get()); - - Common::XmlData ret; - ret.setType("OK"); - sendPacket(ret); - - signalFinished(); - } -} - -} -} -} -} |