From 5a7d02cc94183b6c94c4e6fef5139ffe1577ff25 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Mon, 18 Oct 2021 01:14:45 +1300 Subject: [PATCH] Add world name to online event if instance isn't private --- html/src/app.js | 27 ++++++++++++++++++++++++--- html/src/vr.js | 9 ++++++++- html/src/vr.pug | 16 ++++++++++------ 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index 4086d680..4cadf543 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -4883,7 +4883,14 @@ speechSynthesis.getVoices(); ); break; case 'Online': - this.speak(`${noty.displayName} has logged in`); + var locationName = ''; + if (noty.worldName) { + locationName = ` to ${this.displayLocation( + noty.location, + noty.worldName + )}`; + } + this.speak(`${noty.displayName} has logged in${locationName}`); break; case 'Offline': this.speak(`${noty.displayName} has logged out`); @@ -5016,9 +5023,16 @@ speechSynthesis.getVoices(); ); break; case 'Online': + var locationName = ''; + if (noty.worldName) { + locationName = ` to ${this.displayLocation( + noty.location, + noty.worldName + )}`; + } AppApi.XSNotification( 'VRCX', - `${noty.displayName} has logged in`, + `${noty.displayName} has logged in${locationName}`, timeout, image ); @@ -5215,9 +5229,16 @@ speechSynthesis.getVoices(); ); break; case 'Online': + var locationName = ''; + if (noty.worldName) { + locationName = ` to ${this.displayLocation( + noty.location, + noty.worldName + )}`; + } AppApi.DesktopNotification( noty.displayName, - 'has logged in', + `has logged in${locationName}`, image ); break; diff --git a/html/src/vr.js b/html/src/vr.js index f5aab843..0135cbc7 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -368,7 +368,14 @@ import configRepository from './repository/config.js'; )}`; break; case 'Online': - text = `${noty.displayName} has logged in`; + var locationName = ''; + if (noty.worldName) { + locationName = ` to ${this.displayLocation( + noty.location, + noty.worldName + )}`; + } + text = `${noty.displayName} has logged in${locationName}`; break; case 'Offline': text = `${noty.displayName} has logged out`; diff --git a/html/src/vr.pug b/html/src/vr.pug index b420c416..5568e17d 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -31,7 +31,9 @@ html .detail span.extra span.time {{ feed.created_at | formatDate('HH:MI') }} - | #[span.name(v-text="feed.displayName")] ✔ + | #[span.name(v-text="feed.displayName")] ✔ + template(v-if="feed.worldName") + | #[location(:location="feed.location" :hint="feed.worldName")] div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") .detail span.extra @@ -122,9 +124,9 @@ html .detail span.extra span.time {{ feed.created_at | formatDate('HH:MI') }} - | ✨ #[span.name(v-text="feed.displayName")] + | ✨ #[span.name(v-text="feed.displayName")] template(v-if="feed.worldName") - | #[location(:location="feed.instanceId" :hint="feed.worldName")] + | #[location(:location="feed.instanceId" :hint="feed.worldName")] div(v-else-if="feed.type === 'AvatarChange'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") .detail span.extra @@ -178,7 +180,9 @@ html .detail span.extra span.time {{ feed.created_at | formatDate('HH:MI') }} - | #[span.name(v-text="feed.displayName")] has logged in + | #[span.name(v-text="feed.displayName")] has logged in + template(v-if="feed.worldName") + | to #[location(:location="feed.location" :hint="feed.worldName")] div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") .detail span.extra @@ -268,9 +272,9 @@ html .detail span.extra span.time {{ feed.created_at | formatDate('HH:MI') }} - | #[span.name(v-text="feed.displayName")] has spawned a portal + | #[span.name(v-text="feed.displayName")] has spawned a portal template(v-if="feed.worldName") - | to #[location(:location="feed.instanceId" :hint="feed.worldName")] + | to #[location(:location="feed.instanceId" :hint="feed.worldName")] div(v-else-if="feed.type === 'AvatarChange'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") .detail span.extra