diff --git a/html/src/app.js b/html/src/app.js index 6f23b07f..1f006cc4 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -3460,6 +3460,15 @@ import gameLogService from './service/gamelog.js' ++j; } } + var { data } = this.notificationTable; + for (i = 0; i < data.length; i++) { + var ctx = data[i]; + arr.push({ + ...ctx, + isFriend: this.friends.has(ctx.senderUserId), + isFavorite: API.cachedFavoritesByObjectId.has(ctx.senderUserId) + }); + } arr.sort(function (a, b) { if (a.created_at < b.created_at) { return 1; @@ -5546,7 +5555,7 @@ import gameLogService from './service/gamelog.js' $app.data.hidePrivateFromFeed = configRepository.getBool('VRCX_hidePrivateFromFeed'); $app.data.hideLoginsFromFeed = configRepository.getBool('VRCX_hideLoginsFromFeed'); $app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed'); - $app.data.vipNotifications = configRepository.getBool('VRCX_VIPNotifications'); + $app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications'); $app.data.minimalFeed = configRepository.getBool('VRCX_minimalFeed'); var saveOpenVROption = function () { configRepository.setBool('openVR', this.openVR); @@ -5554,7 +5563,7 @@ import gameLogService from './service/gamelog.js' configRepository.setBool('VRCX_hidePrivateFromFeed', this.hidePrivateFromFeed); configRepository.setBool('VRCX_hideLoginsFromFeed', this.hideLoginsFromFeed); configRepository.setBool('VRCX_hideDevicesFromFeed', this.hideDevicesFromFeed); - configRepository.setBool('VRCX_VIPNotifications', this.vipNotifications); + configRepository.setBool('VRCX_overlayNotifications', this.overlayNotifications); configRepository.setBool('VRCX_minimalFeed', this.minimalFeed); }; $app.watch.openVR = saveOpenVROption; @@ -5562,7 +5571,7 @@ import gameLogService from './service/gamelog.js' $app.watch.hidePrivateFromFeed = saveOpenVROption; $app.watch.hideLoginsFromFeed = saveOpenVROption; $app.watch.hideDevicesFromFeed = saveOpenVROption; - $app.watch.vipNotifications = saveOpenVROption; + $app.watch.overlayNotifications = saveOpenVROption; $app.watch.minimalFeed = saveOpenVROption; $app.data.isDarkMode = configRepository.getBool('isDarkMode'); $appDarkStyle.disabled = $app.data.isDarkMode === false; diff --git a/html/src/index.pug b/html/src/index.pug index e0966a0a..00f0a30a 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -498,19 +498,19 @@ html span(style="display:inline-block;min-width:150px") Force Run el-switch(v-model="openVRAlways") div(style="font-size:12px;margin-top:5px") - span(style="display:inline-block;min-width:150px") Hide VR devices + span(style="display:inline-block;min-width:150px") Hide VR Devices el-switch(v-model="hideDevicesFromFeed") div(style="font-size:12px;margin-top:5px") span(style="display:inline-block;min-width:150px") Hide Online/Offline el-switch(v-model="hideLoginsFromFeed") div(style="font-size:12px;margin-top:5px") - span(style="display:inline-block;min-width:150px") Hide Private worlds + span(style="display:inline-block;min-width:150px") Hide Private Worlds el-switch(v-model="hidePrivateFromFeed") div(style="font-size:12px;margin-top:5px") - span(style="display:inline-block;min-width:150px") Overlay notifications - el-switch(v-model="vipNotifications") + span(style="display:inline-block;min-width:150px") Overlay Notifications + el-switch(v-model="overlayNotifications") div(style="font-size:12px;margin-top:5px") - span(style="display:inline-block;min-width:150px") Minimal feed icons + span(style="display:inline-block;min-width:150px") Minimal Feed Icons el-switch(v-model="minimalFeed") div(style="margin-top:30px") span(style="font-weight:bold") Window diff --git a/html/src/vr.js b/html/src/vr.js index 5bb43e87..232d6503 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -672,12 +672,18 @@ import webApiService from './service/webapi.js'; } } } + if (feed.type === 'invite') { + if (!map[feed.senderUsername] || + map[feed.senderUsername] < feed.created_at) { + map[feed.senderUsername] = feed.created_at; + } + } }); // disable notification on busy if (this.currentUserStatus === 'busy') { return; } - if (configRepository.getBool('VRCX_VIPNotifications') === true) { + if (configRepository.getBool('VRCX_overlayNotifications') === true) { var notys = []; this.feeds.forEach((feed) => { if (feed.isFavorite) { @@ -697,6 +703,13 @@ import webApiService from './service/webapi.js'; } } } + if (feed.type === 'invite') { + if (!map[feed.senderUsername] || + map[feed.senderUsername] < feed.created_at) { + map[feed.senderUsername] = feed.created_at; + notys.push(feed); + } + } }); var bias = new Date(Date.now() - 60000).toJSON(); var theme = 'relax'; @@ -734,6 +747,13 @@ import webApiService from './service/webapi.js'; text: `${noty.displayName} has logged out` }).show(); break; + case 'invite': + new Noty({ + type: 'alert', + theme: theme, + text: `${noty.senderUsername} has invited you to ${noty.details.worldName}` + }).show(); + break; } } }); diff --git a/html/src/vr.pug b/html/src/vr.pug index a0d941fa..45f1b655 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -52,6 +52,12 @@ html span.extra span.time {{ feed.created_at | formatDate('HH:MI') }} location(:location="feed.data") + div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") + .detail + span.extra + span.time {{ feed.created_at | formatDate('HH:MI') }} + | 📨 #[span.name(v-text="feed.senderUsername")] + | #[span(v-text="feed.details.worldName")] template(v-else) template(v-for="feed in feeds") .x-friend-item(v-if="feed.type === 'GPS'" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") @@ -89,6 +95,12 @@ html span.extra span.time {{ feed.created_at | formatDate('HH:MI') }} location(:location="feed.data") + div(v-else-if="feed.type === 'invite'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }") + .detail + span.extra + span.time {{ feed.created_at | formatDate('HH:MI') }} + | #[span.name(v-text="feed.senderUsername")] has invited you to + | #[span(v-text="feed.details.worldName")] .x-container div(style="display:flex;flex-direction:row") template(v-if="devices.length")