Support both internal and external rttys

This commit is contained in:
stephb9959
2021-11-26 22:38:47 -08:00
parent 5e8b23cbeb
commit c74efb0287

View File

@@ -723,14 +723,14 @@ void RESTAPI_device_commandHandler::MakeRequest() {
.Port = MicroService::instance().ConfigGetInt("rtty.port", 5912),
.Token = MicroService::instance().ConfigGetString("rtty.token", "nothing"),
.TimeOut = MicroService::instance().ConfigGetInt("rtty.timeout", 60),
.ConnectionId = MicroService::instance().CreateHash(std::to_string(std::time(nullptr))+SerialNumber_),
.ConnectionId = MicroService::instance().CreateHash(std::to_string(std::time(nullptr))+SerialNumber_).substr(0,32),
.Started = (uint64_t)time(nullptr),
.CommandUUID = CommandUUID,
.ViewPort = MicroService::instance().ConfigGetInt("rtty.viewport", 5913),
};
if(RTTYS_server()->UseInternal()) {
Rtty.Token = MicroService::instance().CreateHash(UserInfo_.webtoken.refresh_token_ + std::to_string(std::time(nullptr)));
Rtty.Token = MicroService::instance().CreateHash(UserInfo_.webtoken.refresh_token_ + std::to_string(std::time(nullptr))).substr(0,32);
RTTYS_server()->CreateEndPoint(Rtty.ConnectionId,Rtty.Token);
}