Discord RPC private toggle

This commit is contained in:
Natsumi
2021-09-21 00:58:16 +12:00
parent 75b856aa8a
commit c366a6506e
3 changed files with 53 additions and 17 deletions
+48 -15
View File
@@ -6779,7 +6779,7 @@ speechSynthesis.getVoices();
// App: Feed // App: Feed
$app.methods.feedSearch = function (row, filter) { $app.methods.feedSearch = function (row, filter) {
var { value } = filter; var {value} = filter;
if (!value) { if (!value) {
return true; return true;
} }
@@ -6813,7 +6813,9 @@ speechSynthesis.getVoices();
if (String(row.displayName).toUpperCase().includes(value)) { if (String(row.displayName).toUpperCase().includes(value)) {
return true; return true;
} }
if (String(row.statusDescription).toUpperCase().includes(value)) { if (
String(row.statusDescription).toUpperCase().includes(value)
) {
return true; return true;
} }
return false; return false;
@@ -6841,8 +6843,7 @@ speechSynthesis.getVoices();
{ {
prop: 'displayName', prop: 'displayName',
value: '', value: '',
filterFn: (row, filter) => filterFn: (row, filter) => $app.feedSearch(row, filter)
$app.feedSearch(row, filter)
}, },
{ {
prop: 'userId', prop: 'userId',
@@ -7204,10 +7205,12 @@ speechSynthesis.getVoices();
$app.data.discordActive = configRepository.getBool('discordActive'); $app.data.discordActive = configRepository.getBool('discordActive');
$app.data.discordInstance = configRepository.getBool('discordInstance'); $app.data.discordInstance = configRepository.getBool('discordInstance');
$app.data.discordJoinButton = configRepository.getBool('discordJoinButton'); $app.data.discordJoinButton = configRepository.getBool('discordJoinButton');
$app.data.discordHideInvite = configRepository.getBool('discordHideInvite');
$app.methods.saveDiscordOption = function () { $app.methods.saveDiscordOption = function () {
configRepository.setBool('discordActive', this.discordActive); configRepository.setBool('discordActive', this.discordActive);
configRepository.setBool('discordInstance', this.discordInstance); configRepository.setBool('discordInstance', this.discordInstance);
configRepository.setBool('discordJoinButton', this.discordJoinButton); configRepository.setBool('discordJoinButton', this.discordJoinButton);
configRepository.setBool('discordHideInvite', this.discordHideInvite);
if (!this.discordActive) { if (!this.discordActive) {
Discord.SetText('', ''); Discord.SetText('', '');
Discord.SetActive(false); Discord.SetActive(false);
@@ -7217,7 +7220,7 @@ speechSynthesis.getVoices();
}; };
$app.methods.gameLogSearch = function (row, filter) { $app.methods.gameLogSearch = function (row, filter) {
var { value } = filter; var {value} = filter;
if (!value) { if (!value) {
return true; return true;
} }
@@ -7284,8 +7287,7 @@ speechSynthesis.getVoices();
{ {
prop: 'displayName', prop: 'displayName',
value: '', value: '',
filterFn: (row, filter) => filterFn: (row, filter) => $app.gameLogSearch(row, filter)
$app.gameLogSearch(row, filter)
}, },
{ {
prop: 'displayName', prop: 'displayName',
@@ -7879,6 +7881,13 @@ speechSynthesis.getVoices();
} }
this.lastLocation$ = L; this.lastLocation$ = L;
} }
var hidePrivate = false;
if (
(this.discordHideInvite && L.accessType === 'Invite') ||
L.accessType === 'Invite+'
) {
hidePrivate = true;
}
switch (API.currentUser.status) { switch (API.currentUser.status) {
case 'active': case 'active':
L.statusName = 'Online'; L.statusName = 'Online';
@@ -7891,18 +7900,42 @@ speechSynthesis.getVoices();
case 'ask me': case 'ask me':
L.statusName = 'Ask Me'; L.statusName = 'Ask Me';
L.statusImage = 'askme'; L.statusImage = 'askme';
hidePrivate = true;
break; break;
case 'busy': case 'busy':
L.statusName = 'Do Not Disturb'; L.statusName = 'Do Not Disturb';
L.statusImage = 'busy'; L.statusImage = 'busy';
hidePrivate = true;
break; break;
} }
var appId = '883308884863901717'; var appId = '883308884863901717';
var bigIcon = 'vrchat'; var bigIcon = 'vrchat';
var instanceId = L.instanceId;
var partySize = this.lastLocation.playerList.size;
var partyMaxSize = L.worldCapacity;
var buttonText = 'Join';
var buttonUrl = L.joinUrl;
if (!this.discordJoinButton) {
buttonText = '';
buttonUrl = '';
}
if (!this.discordInstance) {
partySize = 0;
partyMaxSize = 0;
}
if (hidePrivate) {
instanceId = '';
partySize = 0;
partyMaxSize = 0;
buttonText = '';
buttonUrl = '';
}
if ( if (
L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1' || (!hidePrivate &&
L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') ||
L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83' L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
) { ) {
// dance world rpc
if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') { if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') {
appId = '784094509008551956'; appId = '784094509008551956';
bigIcon = 'pypy'; bigIcon = 'pypy';
@@ -7925,11 +7958,11 @@ speechSynthesis.getVoices();
'Powered by VRCX', // big icon hover text 'Powered by VRCX', // big icon hover text
L.statusImage, // small icon L.statusImage, // small icon
L.statusName, // small icon hover text L.statusName, // small icon hover text
L.instanceId, // party id instanceId, // party id
this.lastLocation.playerList.size, // party size partySize, // party size
L.worldCapacity, // party max size partyMaxSize, // party max size
'Join', // button text buttonText, // button text
L.joinUrl, // button url buttonUrl, // button url
appId // app id appId // app id
); );
// NOTE // NOTE
@@ -7937,8 +7970,8 @@ speechSynthesis.getVoices();
if (L.worldName.length < 2) { if (L.worldName.length < 2) {
L.worldName += '\uFFA0'.repeat(2 - L.worldName.length); L.worldName += '\uFFA0'.repeat(2 - L.worldName.length);
} }
if (API.currentUser.status === 'busy') { if (hidePrivate) {
Discord.SetText('Do Not Disturb', ''); Discord.SetText('Private', '');
Discord.SetTimestamps(0, 0); Discord.SetTimestamps(0, 0);
} else if (this.discordInstance) { } else if (this.discordInstance) {
Discord.SetText(L.worldName, L.accessType); Discord.SetText(L.worldName, L.accessType);
+4 -1
View File
@@ -780,11 +780,14 @@ html
span.name Enable span.name Enable
el-switch(v-model="discordActive" @change="saveDiscordOption") el-switch(v-model="discordActive" @change="saveDiscordOption")
div.options-container-item div.options-container-item
span.name Instance type span.name Instance type/player count
el-switch(v-model="discordInstance" @change="saveDiscordOption" :disabled="!discordActive") el-switch(v-model="discordInstance" @change="saveDiscordOption" :disabled="!discordActive")
div.options-container-item div.options-container-item
span.name Join button (public only) span.name Join button (public only)
el-switch(v-model="discordJoinButton" @change="saveDiscordOption" :disabled="!discordActive") el-switch(v-model="discordJoinButton" @change="saveDiscordOption" :disabled="!discordActive")
div.options-container-item
span.name Hide world details in private
el-switch(v-model="discordHideInvite" @change="saveDiscordOption" :disabled="!discordActive")
div.options-container div.options-container
span.header SteamVR Overlay span.header SteamVR Overlay
div.options-container-item div.options-container-item
+1 -1
View File
@@ -371,7 +371,7 @@ class Database {
async getGamelogDatabase() { async getGamelogDatabase() {
var gamelogDatabase = []; var gamelogDatabase = [];
var date = new Date(); var date = new Date();
date.setDate(date.getDate() - 3); // 3 day limit date.setDate(date.getDate() - 7); // 7 day limit
var dateOffset = date.toJSON(); var dateOffset = date.toJSON();
await sqliteService.execute((dbRow) => { await sqliteService.execute((dbRow) => {
var row = { var row = {