summaryrefslogtreecommitdiffstats
path: root/src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp')
-rw-r--r--src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp b/src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp
index 99d2818..61bbf07 100644
--- a/src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp
+++ b/src/modules/UserListManager/RequestHandlers/UserListRequestHandlerGroup.cpp
@@ -55,6 +55,24 @@ void UserListRequestHandlerGroup::handleUserListDownloadRequest(boost::shared_pt
Util::serializeUserList(userList.get(), ret);
}
+void UserListRequestHandlerGroup::handleUserListCopyRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret, Common::Connection *connection) {
+ if(!connection->isAuthenticated())
+ throw(Core::Exception(Core::Exception::PERMISSION));
+
+ userListManager->copyUserList(packet->get<const std::string&>("fromName"), packet->get<const std::string&>("toName"));
+
+ ret->setType("OK");
+}
+
+void UserListRequestHandlerGroup::handleUserListRenameRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret, Common::Connection *connection) {
+ if(!connection->isAuthenticated())
+ throw(Core::Exception(Core::Exception::PERMISSION));
+
+ userListManager->renameUserList(packet->get<const std::string&>("fromName"), packet->get<const std::string&>("toName"));
+
+ ret->setType("OK");
+}
+
void UserListRequestHandlerGroup::handleUserListRemoveRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret, Common::Connection *connection) {
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
@@ -94,6 +112,24 @@ void UserListRequestHandlerGroup::handleUserListDiffDownloadRequest(boost::share
Util::serializeUserListDiff(diff.get(), ret);
}
+void UserListRequestHandlerGroup::handleUserListDiffCopyRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret, Common::Connection *connection) {
+ if(!connection->isAuthenticated())
+ throw(Core::Exception(Core::Exception::PERMISSION));
+
+ userListManager->copyUserListDiff(packet->get<const std::string&>("fromName"), packet->get<const std::string&>("toName"));
+
+ ret->setType("OK");
+}
+
+void UserListRequestHandlerGroup::handleUserListDiffRenameRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret, Common::Connection *connection) {
+ if(!connection->isAuthenticated())
+ throw(Core::Exception(Core::Exception::PERMISSION));
+
+ userListManager->renameUserListDiff(packet->get<const std::string&>("fromName"), packet->get<const std::string&>("toName"));
+
+ ret->setType("OK");
+}
+
void UserListRequestHandlerGroup::handleUserListDiffRemoveRequest(boost::shared_ptr<const Common::XmlData> packet, Common::XmlData *ret, Common::Connection *connection) {
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
@@ -108,10 +144,14 @@ UserListRequestHandlerGroup::UserListRequestHandlerGroup(Server::Application *ap
: application(application0), userListManager(userListManager0) {
registerHandler("ListUserLists", boost::bind(&UserListRequestHandlerGroup::handleUserListListRequest, this, _1, _2, _3));
registerHandler("DownloadUserList", boost::bind(&UserListRequestHandlerGroup::handleUserListDownloadRequest, this, _1, _2, _3));
+ registerHandler("CopyUserList", boost::bind(&UserListRequestHandlerGroup::handleUserListCopyRequest, this, _1, _2, _3));
+ registerHandler("RenameUserList", boost::bind(&UserListRequestHandlerGroup::handleUserListRenameRequest, this, _1, _2, _3));
registerHandler("RemoveUserList", boost::bind(&UserListRequestHandlerGroup::handleUserListRemoveRequest, this, _1, _2, _3));
registerHandler("ListUserListDiffs", boost::bind(&UserListRequestHandlerGroup::handleUserListDiffListRequest, this, _1, _2, _3));
registerHandler("DownloadUserListDiff", boost::bind(&UserListRequestHandlerGroup::handleUserListDiffDownloadRequest, this, _1, _2, _3));
+ registerHandler("CopyUserListDiff", boost::bind(&UserListRequestHandlerGroup::handleUserListDiffCopyRequest, this, _1, _2, _3));
+ registerHandler("RenameUserListDiff", boost::bind(&UserListRequestHandlerGroup::handleUserListDiffRenameRequest, this, _1, _2, _3));
registerHandler("RemoveUserListDiff", boost::bind(&UserListRequestHandlerGroup::handleUserListDiffRemoveRequest, this, _1, _2, _3));
}