mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
- The first part
- Added CodeDocs config file for customization - Fixing LGTM alerts - LGTM bug fixed again - added token option to hyperion-remote - fix DBManager::getDB() - next bugfix - correct broken signal from SettingManager to Hyperion - Token list is created after the schema is fetched Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -543,6 +543,25 @@ void JsonConnection::setVideoMode(QString videoMode)
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setToken(const QString &token)
|
||||
{
|
||||
// create command
|
||||
QJsonObject command;
|
||||
command["command"] = QString("authorize");
|
||||
command["subcommand"] = QString("login");
|
||||
|
||||
if (token.size() < 36)
|
||||
throw std::runtime_error("The given token length is too short.");
|
||||
|
||||
command["token"] = token;
|
||||
|
||||
// send command message
|
||||
QJsonObject reply = sendMessage(command);
|
||||
|
||||
// parse reply message
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
QJsonObject JsonConnection::sendMessage(const QJsonObject & message)
|
||||
{
|
||||
// serialize message
|
||||
|
||||
Reference in New Issue
Block a user