Using new permissions system consequently
This commit is contained in:
@@ -157,6 +157,19 @@ void WebClient::sendCommand(const ts::Command &command, bool low) {
|
||||
this->sendJson(value);
|
||||
}
|
||||
|
||||
void WebClient::sendCommand(const ts::command_builder &command, bool low) {
|
||||
#if false
|
||||
Json::Value value{};
|
||||
value["type"] = "command2";
|
||||
value["payload"] = command.build();
|
||||
this->sendJson(value);
|
||||
#else
|
||||
auto data = command.build();
|
||||
Command parsed_command = Command::parse(pipes::buffer_view{data.data(), data.length()}, true, false);
|
||||
this->sendCommand(parsed_command, low);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool WebClient::closeConnection(const std::chrono::system_clock::time_point& timeout) {
|
||||
bool flushing = timeout.time_since_epoch().count() > 0;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace ts {
|
||||
|
||||
void sendJson(const Json::Value&);
|
||||
void sendCommand(const ts::Command &command, bool low = false) override;
|
||||
void sendCommand(const ts::command_builder &command, bool low) override;
|
||||
|
||||
bool disconnect(const std::string &reason) override;
|
||||
bool closeConnection(const std::chrono::system_clock::time_point& timeout = std::chrono::system_clock::time_point()) override;
|
||||
|
||||
Reference in New Issue
Block a user