Add API call to retrieve user agent.

This commit is contained in:
Kasen IO 2020-07-21 02:36:55 -04:00
parent 647b45323e
commit f4016bb0d5
2 changed files with 12 additions and 0 deletions

View file

@ -29,6 +29,7 @@
#include "Menu.h"
#include "OffscreenUi.h"
#include "commerce/QmlCommerce.h"
#include "NetworkingConstants.h"
static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation";
@ -411,6 +412,10 @@ QString WindowScriptingInterface::checkVersion() {
return QCoreApplication::applicationVersion();
}
QString WindowScriptingInterface::getUserAgent() {
return NetworkingConstants::VIRCADIA_USER_AGENT;
}
QString WindowScriptingInterface::protocolSignature() {
return protocolVersionsSignatureBase64();
}

View file

@ -295,6 +295,13 @@ public slots:
*/
QString checkVersion();
/**jsdoc
* Gets Interface's user agent.
* @function Window.getUserAgent
* @returns {string} Interface's user agent.
*/
QString getUserAgent();
/**jsdoc
* Gets the signature for Interface's protocol version.
* @function Window.protocolSignature