Removed old junk
This commit is contained in:
parent
5991e5f4ad
commit
82aa59fdf9
@ -12,24 +12,9 @@
|
||||
#include <sql/SqlQuery.h>
|
||||
|
||||
namespace ts {
|
||||
enum GroupType {
|
||||
GROUP_TYPE_TEMPLATE,
|
||||
GROUP_TYPE_NORMAL,
|
||||
GROUP_TYPE_QUERY //Only aplies for servergroups
|
||||
};
|
||||
|
||||
enum GroupTarget {
|
||||
GROUPTARGET_SERVER,
|
||||
GROUPTARGET_CHANNEL
|
||||
};
|
||||
|
||||
enum GroupNameMode {
|
||||
GROUP_NAMEMODE_HIDDEN,
|
||||
GROUP_NAMEMODE_BEFORE,
|
||||
GROUP_NAMEMODE_BEHIND
|
||||
};
|
||||
}
|
||||
|
||||
DEFINE_TRANSFORMS(ts::GroupType, uint8_t);
|
||||
DEFINE_TRANSFORMS(ts::GroupTarget, uint8_t);
|
||||
DEFINE_TRANSFORMS(ts::GroupNameMode, uint8_t);
|
||||
DEFINE_TRANSFORMS(ts::GroupTarget, uint8_t);
|
@ -13,6 +13,7 @@
|
||||
#include "../InstanceHandler.h"
|
||||
#include <sql/insert.h>
|
||||
#include <log/LogUtils.h>
|
||||
#include <src/groups/Group.h>
|
||||
|
||||
using namespace ts;
|
||||
using namespace ts::server;
|
||||
@ -327,7 +328,7 @@ bool VirtualServerManager::try_deploy_snapshot(std::string &error, ts::ServerId
|
||||
/* server groups */
|
||||
{
|
||||
sql::model insert_model{this->handle->getSql(), "INSERT INTO `groups` (`serverId`, `target`, `type`, `displayName`, `original_group_id`) VALUES (:serverId, :target, :type, :name, :id)"};
|
||||
insert_model.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_SERVER).value(":type", GroupType::GROUP_TYPE_NORMAL);
|
||||
insert_model.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_SERVER).value(":type", groups::GroupType::GROUP_TYPE_NORMAL);
|
||||
|
||||
for(auto& group : snapshot_data.parsed_server_groups) {
|
||||
auto result = insert_model.command().value(":name", group.name).value(":id", group.group_id).execute();
|
||||
@ -336,7 +337,7 @@ bool VirtualServerManager::try_deploy_snapshot(std::string &error, ts::ServerId
|
||||
}
|
||||
|
||||
sql::command{this->handle->getSql(), "SELECT `original_group_id`,`groupId` FROM `groups` WHERE `serverId` = :serverId AND `target` = :target AND `type` = :type"}
|
||||
.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_SERVER).value(":type", GroupType::GROUP_TYPE_NORMAL)
|
||||
.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_SERVER).value(":type", groups::GroupType::GROUP_TYPE_NORMAL)
|
||||
.query([&](int length, std::string* values, std::string* names) {
|
||||
GroupId original_id, new_id;
|
||||
try {
|
||||
@ -444,7 +445,7 @@ bool VirtualServerManager::try_deploy_snapshot(std::string &error, ts::ServerId
|
||||
/* channel groups */
|
||||
{
|
||||
sql::model insert_model{this->handle->getSql(), "INSERT INTO `groups` (`serverId`, `target`, `type`, `displayName`, `original_group_id`) VALUES (:serverId, :target, :type, :name, :id)"};
|
||||
insert_model.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_CHANNEL).value(":type", GroupType::GROUP_TYPE_NORMAL);
|
||||
insert_model.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_CHANNEL).value(":type", groups::GroupType::GROUP_TYPE_NORMAL);
|
||||
|
||||
for(auto& group : snapshot_data.parsed_channel_groups) {
|
||||
auto result = insert_model.command().value(":name", group.name).value(":id", group.group_id).execute();
|
||||
@ -453,7 +454,7 @@ bool VirtualServerManager::try_deploy_snapshot(std::string &error, ts::ServerId
|
||||
}
|
||||
|
||||
sql::command{this->handle->getSql(), "SELECT `original_group_id`,`groupId` FROM `groups` WHERE `serverId` = :serverId AND `target` = :target AND `type` = :type"}
|
||||
.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_CHANNEL).value(":type", GroupType::GROUP_TYPE_NORMAL)
|
||||
.value(":serverId", target_server_id).value(":target", GroupTarget::GROUPTARGET_CHANNEL).value(":type", groups::GroupType::GROUP_TYPE_NORMAL)
|
||||
.query([&](int length, std::string* values, std::string* names) {
|
||||
GroupId original_id, new_id;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user