diff --git a/CHANGELOG.md b/CHANGELOG.md index 891bb916..f0525e39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.13.2] + +### Fixed +- The status message not updating when the visibility remained the same +- The status message not setting to an empty value + ## [1.13.1] ### Fixed diff --git a/package.json b/package.json index 53dccce6..eeb34a5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oyasumi", - "version": "1.13.1", + "version": "1.13.2", "author": "Raphiiko", "license": "MIT", "type": "module", diff --git a/src-core/Cargo.lock b/src-core/Cargo.lock index f5fd3399..81bd83b9 100644 --- a/src-core/Cargo.lock +++ b/src-core/Cargo.lock @@ -3860,7 +3860,7 @@ dependencies = [ [[package]] name = "oyasumivr" -version = "1.13.1" +version = "1.13.2" dependencies = [ "async-recursion", "bluest", @@ -3930,7 +3930,7 @@ dependencies = [ [[package]] name = "oyasumivr-shared" -version = "1.13.1" +version = "1.13.2" dependencies = [ "winapi", ] diff --git a/src-core/Cargo.toml b/src-core/Cargo.toml index 6c926b77..b7d099a5 100644 --- a/src-core/Cargo.toml +++ b/src-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oyasumivr" -version = "1.13.1" +version = "1.13.2" description = "" authors = ["Raphiiko"] license = "MIT" diff --git a/src-core/tauri.conf.json b/src-core/tauri.conf.json index 9da81548..01b10123 100644 --- a/src-core/tauri.conf.json +++ b/src-core/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "OyasumiVR", - "version": "1.13.1" + "version": "1.13.2" }, "tauri": { "allowlist": { @@ -201,7 +201,7 @@ "center": true, "theme": "Dark", "transparent": true, - "userAgent": "OyasumiVR/1.13.1 (https://github.com/Raphiiko/OyasumiVR)" + "userAgent": "OyasumiVR/1.13.2 (https://github.com/Raphiiko/OyasumiVR)" }, { "width": 700, @@ -216,7 +216,7 @@ "skipTaskbar": true, "minimizable": false, "alwaysOnTop": true, - "userAgent": "OyasumiVR/1.13.1 (https://github.com/Raphiiko/OyasumiVR)" + "userAgent": "OyasumiVR/1.13.2 (https://github.com/Raphiiko/OyasumiVR)" } ] } diff --git a/src-elevated-sidecar/Cargo.toml b/src-elevated-sidecar/Cargo.toml index 7acd9920..1f9262ac 100644 --- a/src-elevated-sidecar/Cargo.toml +++ b/src-elevated-sidecar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oyasumivr-elevated-sidecar" -version = "1.13.1" +version = "1.13.2" authors = ["Raphiiko"] license = "MIT" edition = "2021" diff --git a/src-overlay-ui/package.json b/src-overlay-ui/package.json index 91975743..98c23050 100644 --- a/src-overlay-ui/package.json +++ b/src-overlay-ui/package.json @@ -1,6 +1,6 @@ { "name": "oyasumivr-overlay-ui", - "version": "1.13.1", + "version": "1.13.2", "private": true, "scripts": { "dev": "vite dev", diff --git a/src-shared-rust/Cargo.toml b/src-shared-rust/Cargo.toml index 1ad460cc..bcc726bf 100644 --- a/src-shared-rust/Cargo.toml +++ b/src-shared-rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oyasumivr-shared" -version = "1.13.1" +version = "1.13.2" authors = ["Raphiiko"] edition = "2021" license = "MIT" diff --git a/src-shared-ts/package.json b/src-shared-ts/package.json index 8ce241d2..a9cd7bde 100644 --- a/src-shared-ts/package.json +++ b/src-shared-ts/package.json @@ -2,7 +2,7 @@ "name": "src-shared-ts", "description": "Shared typescript code for Oyasumi modules", "scripts": {}, - "version": "1.13.1", + "version": "1.13.2", "author": "Raphiiko", "license": "MIT", "type": "module", diff --git a/src-ui/app/services/status-automations/status-change-for-player-count-automation.service.ts b/src-ui/app/services/status-automations/status-change-for-player-count-automation.service.ts index 7bc2de81..d2be19f0 100644 --- a/src-ui/app/services/status-automations/status-change-for-player-count-automation.service.ts +++ b/src-ui/app/services/status-automations/status-change-for-player-count-automation.service.ts @@ -81,28 +81,32 @@ export class StatusChangeForPlayerCountAutomationService { ) .subscribe(async (newStatus) => { // Set new status - await this.vrchat.setStatus(newStatus.status, newStatus.statusMessage); - if (await this.notifications.notificationTypeEnabled('AUTO_UPDATED_VRC_STATUS')) { - await this.notifications.send( - this.translate.instant('notifications.vrcStatusChanged.content', { - newStatus: ( - (newStatus.statusMessage ?? newStatus.oldStatusMessage) + - ' (' + - (newStatus.status ?? newStatus.oldStatus) + - ')' - ).trim(), - }) - ); + let success = await this.vrchat + .setStatus(newStatus.status, newStatus.statusMessage) + .catch(() => false); + if (success) { + if (await this.notifications.notificationTypeEnabled('AUTO_UPDATED_VRC_STATUS')) { + await this.notifications.send( + this.translate.instant('notifications.vrcStatusChanged.content', { + newStatus: ( + (newStatus.statusMessage ?? newStatus.oldStatusMessage) + + ' (' + + (newStatus.status ?? newStatus.oldStatus) + + ')' + ).trim(), + }) + ); + } + this.eventLog.logEvent({ + type: 'statusChangedOnPlayerCountChange', + reason: newStatus.reason, + threshold: this.config.limit, + newStatus: newStatus.status, + oldStatus: newStatus.oldStatus, + newStatusMessage: newStatus.statusMessage, + oldStatusMessage: newStatus.oldStatusMessage, + } as EventLogStatusChangedOnPlayerCountChange); } - this.eventLog.logEvent({ - type: 'statusChangedOnPlayerCountChange', - reason: newStatus.reason, - threshold: this.config.limit, - newStatus: newStatus.status, - oldStatus: newStatus.oldStatus, - newStatusMessage: newStatus.statusMessage, - oldStatusMessage: newStatus.oldStatusMessage, - } as EventLogStatusChangedOnPlayerCountChange); }); } diff --git a/src-ui/app/services/status-automations/status-change-general-events-automation.service.ts b/src-ui/app/services/status-automations/status-change-general-events-automation.service.ts index 85a95aca..09027988 100644 --- a/src-ui/app/services/status-automations/status-change-general-events-automation.service.ts +++ b/src-ui/app/services/status-automations/status-change-general-events-automation.service.ts @@ -70,33 +70,35 @@ export class StatusChangeGeneralEventsAutomationService { } return { status, statusMessage, sleepMode }; }), - filter((data) => Boolean(data.status || data.statusMessage)), + filter((data) => Boolean(data.status !== null || data.statusMessage !== null)), debounceTime(500) ) .subscribe(async ({ status, statusMessage, sleepMode }) => { const oldStatus = this.vrcUser?.status; const oldStatusMessage = this.vrcUser?.statusDescription; - await this.vrchat.setStatus(status, statusMessage); - if (await this.notifications.notificationTypeEnabled('AUTO_UPDATED_VRC_STATUS')) { - await this.notifications.send( - this.translate.instant('notifications.vrcStatusChanged.content', { - newStatus: ( - (statusMessage ?? oldStatusMessage) + - ' (' + - (status ?? oldStatus) + - ')' - ).trim(), - }) - ); + const success = await this.vrchat.setStatus(status, statusMessage).catch((e) => false); + if (success) { + if (await this.notifications.notificationTypeEnabled('AUTO_UPDATED_VRC_STATUS')) { + await this.notifications.send( + this.translate.instant('notifications.vrcStatusChanged.content', { + newStatus: ( + (statusMessage ?? oldStatusMessage) + + ' (' + + (status ?? oldStatus) + + ')' + ).trim(), + }) + ); + } + this.eventLog.logEvent({ + type: 'statusChangedOnGeneralEvent', + reason: sleepMode ? 'SLEEP_MODE_ENABLED' : 'SLEEP_MODE_DISABLED', + newStatus: status, + oldStatus: oldStatus, + newStatusMessage: statusMessage, + oldStatusMessage: oldStatusMessage, + } as EventLogStatusChangedOnGeneralEvent); } - this.eventLog.logEvent({ - type: 'statusChangedOnGeneralEvent', - reason: sleepMode ? 'SLEEP_MODE_ENABLED' : 'SLEEP_MODE_DISABLED', - newStatus: status, - oldStatus: oldStatus, - newStatusMessage: statusMessage, - oldStatusMessage: oldStatusMessage, - } as EventLogStatusChangedOnGeneralEvent); }); } diff --git a/src-ui/app/services/vrchat.service.ts b/src-ui/app/services/vrchat.service.ts index 78b1592d..f8197a6b 100644 --- a/src-ui/app/services/vrchat.service.ts +++ b/src-ui/app/services/vrchat.service.ts @@ -237,7 +237,7 @@ export class VRChatService { info(`[VRChat] Logged in: ${this._user.value?.displayName}`); } - async setStatus(status: UserStatus | null, statusMessage: string | null): Promise { + async setStatus(status: UserStatus | null, statusMessage: string | null): Promise { // Throw if we don't have a current user const userId = this._user.value?.id; if (!userId) { @@ -247,26 +247,24 @@ export class VRChatService { // Sanitize status message if needed statusMessage = statusMessage === null ? null : statusMessage.replace(/\s+/g, ' ').trim().slice(0, 32); - // Don't do anything if the status is not changing - if (status && this._user.value?.status === status) return; - // Don't do anything if the status message is not changing - if (statusMessage && this._user.value?.statusDescription === statusMessage) return; + const statusChange = status !== null && this._user.value?.status !== status; + const statusMessageChange = + statusMessage !== null && this._user.value?.statusDescription !== statusMessage; + // Don't do anything if there would be no changes + if (!statusChange && !statusMessageChange) return false; // Log status change - if (status && statusMessage) { + if (status !== null && statusMessage !== null) { info(`[VRChat] Changing status to '${statusMessage}' ('${status}')`); - } else if (status) { + } else if (status !== null) { info(`[VRChat] Changing status to '${status}'`); - } else if (statusMessage) { + } else if (statusMessage !== null) { info(`[VRChat] Changing status message to '${statusMessage}'`); - } else { - return; } - // Send status change request try { const body: Record = {}; - if (status) body['status'] = status; - if (statusMessage) body['statusDescription'] = statusMessage; + if (status !== null) body['status'] = status; + if (statusMessage !== null) body['statusDescription'] = statusMessage; const result = await this.apiCallQueue.queueTask>( { typeId: 'STATUS_CHANGE', @@ -283,7 +281,9 @@ export class VRChatService { if (!result.result?.ok) throw result.result; } catch (e) { error(`[VRChat] Failed to update status: ${JSON.stringify(e)}`); + return false; } + return true; } public showLoginModal(autoLogin = false) { diff --git a/src-ui/assets/i18n/en.json b/src-ui/assets/i18n/en.json index fed7a5a5..37dea4e0 100644 --- a/src-ui/assets/i18n/en.json +++ b/src-ui/assets/i18n/en.json @@ -846,7 +846,7 @@ "sleep": "Sleep" }, "addCommand": "Add", - "addParameter": "New parameter", + "addParameter": "Add parameter", "commandCounter": "{count, plural, one {1 Command} other {# Commands}}", "commands": { "COMMAND": {