Skip to content

Commit

Permalink
Merge branch 'release/1.13.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Jun 23, 2024
2 parents 3a2a40c + 5ef85b9 commit fc35b40
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 67 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumi",
"version": "1.13.1",
"version": "1.13.2",
"author": "Raphiiko",
"license": "MIT",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions src-core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr"
version = "1.13.1"
version = "1.13.2"
description = ""
authors = ["Raphiiko"]
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions src-core/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "OyasumiVR",
"version": "1.13.1"
"version": "1.13.2"
},
"tauri": {
"allowlist": {
Expand Down Expand Up @@ -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,
Expand All @@ -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)"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src-elevated-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr-elevated-sidecar"
version = "1.13.1"
version = "1.13.2"
authors = ["Raphiiko"]
license = "MIT"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-overlay-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumivr-overlay-ui",
"version": "1.13.1",
"version": "1.13.2",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
2 changes: 1 addition & 1 deletion src-shared-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr-shared"
version = "1.13.1"
version = "1.13.2"
authors = ["Raphiiko"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-shared-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down
26 changes: 13 additions & 13 deletions src-ui/app/services/vrchat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class VRChatService {
info(`[VRChat] Logged in: ${this._user.value?.displayName}`);
}

async setStatus(status: UserStatus | null, statusMessage: string | null): Promise<void> {
async setStatus(status: UserStatus | null, statusMessage: string | null): Promise<boolean> {
// Throw if we don't have a current user
const userId = this._user.value?.id;
if (!userId) {
Expand All @@ -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<string, string> = {};
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<Response<unknown>>(
{
typeId: 'STATUS_CHANGE',
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src-ui/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@
"sleep": "Sleep"
},
"addCommand": "Add",
"addParameter": "New parameter",
"addParameter": "Add parameter",
"commandCounter": "{count, plural, one {1 Command} other {# Commands}}",
"commands": {
"COMMAND": {
Expand Down

0 comments on commit fc35b40

Please sign in to comment.