mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 20:22:27 +02:00
Add tracking of away.js
This commit is contained in:
parent
23f57367e3
commit
847685d224
3 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,10 @@ void UserActivityLoggerScriptingInterface::openedMarketplace() {
|
|||
logAction("opened_marketplace");
|
||||
}
|
||||
|
||||
void UserActivityLoggerScriptingInterface::toggledAway(bool isAway) {
|
||||
logAction("toggled_away", { { "is_away", isAway } });
|
||||
}
|
||||
|
||||
void UserActivityLoggerScriptingInterface::logAction(QString action, QJsonObject details) {
|
||||
QMetaObject::invokeMethod(&UserActivityLogger::getInstance(), "logAction",
|
||||
Q_ARG(QString, action),
|
||||
|
|
|
@ -22,6 +22,7 @@ class UserActivityLoggerScriptingInterface : public QObject, public Dependency {
|
|||
public:
|
||||
Q_INVOKABLE void enabledEdit();
|
||||
Q_INVOKABLE void openedMarketplace();
|
||||
Q_INVOKABLE void toggledAway(bool isAway);
|
||||
|
||||
private:
|
||||
void logAction(QString action, QJsonObject details = {});
|
||||
|
|
|
@ -158,6 +158,8 @@ function goAway() {
|
|||
return;
|
||||
}
|
||||
|
||||
UserActivityLogger.toggledAway(true);
|
||||
|
||||
isAway = true;
|
||||
print('going "away"');
|
||||
wasMuted = AudioDevice.getMuted();
|
||||
|
@ -189,6 +191,9 @@ function goActive() {
|
|||
if (!isAway) {
|
||||
return;
|
||||
}
|
||||
|
||||
UserActivityLogger.toggledAway(false);
|
||||
|
||||
isAway = false;
|
||||
print('going "active"');
|
||||
if (!wasMuted) {
|
||||
|
|
Loading…
Reference in a new issue