From 32a16eb9c9adff6fa6530c6e19d8afa715e3709a Mon Sep 17 00:00:00 2001 From: Natsumi Date: Thu, 5 Dec 2024 07:46:45 +1300 Subject: [PATCH] 18+ tag, fixes --- html/src/app.js | 2 +- html/src/app.scss | 5 +++++ html/src/mixins/dialogs/userDialog.pug | 3 ++- html/src/repository/database.js | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index c9535327b..00935e9dc 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -7036,7 +7036,7 @@ speechSynthesis.getVoices(); }; $app.methods.addFriendship = function (id) { - if (!this.friendLogInitStatus || this.friendLog.has(id)) { + if (!this.friendLogInitStatus || this.friendLog.has(id) || id === API.currentUser.id) { return; } var ref = API.cachedUsers.get(id); diff --git a/html/src/app.scss b/html/src/app.scss index a6fe6b71f..68323f7de 100644 --- a/html/src/app.scss +++ b/html/src/app.scss @@ -637,6 +637,11 @@ i.x-user-status.busy { border-color: #ff4177 !important; } +.x-tag-age-verification { + color: #ff4177 !important; + border-color: #ff4177 !important; +} + .x-grey { color: #909399; } diff --git a/html/src/mixins/dialogs/userDialog.pug b/html/src/mixins/dialogs/userDialog.pug index b4339398d..e605454b0 100644 --- a/html/src/mixins/dialogs/userDialog.pug +++ b/html/src/mixins/dialogs/userDialog.pug @@ -50,11 +50,12 @@ mixin userDialog() el-tag.x-tag-troll(v-if="userDialog.ref.$isTroll" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Nuisance el-tag.x-tag-troll(v-if="userDialog.ref.$isProbableTroll" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Almost Nuisance el-tag.x-tag-vip(v-if="userDialog.ref.$isModerator" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.user.tags.vrchat_team') }} - el-tag.x-tag-vrcplus(v-if="userDialog.ref.$isVRCPlus" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRC+ el-tag.x-tag-platform-pc(v-if="userDialog.ref.last_platform === 'standalonewindows'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") PC el-tag.x-tag-platform-quest(v-else-if="userDialog.ref.last_platform === 'android'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Android el-tag.x-tag-platform-ios(v-else-if="userDialog.ref.last_platform === 'ios'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") iOS el-tag.x-tag-platform-other(v-else-if="userDialog.ref.last_platform" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ userDialog.ref.last_platform }} + el-tag.x-tag-age-verification(v-if="userDialog.ref.ageVerificationStatus && userDialog.ref.ageVerificationStatus !== 'hidden'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ userDialog.ref.ageVerificationStatus }} + el-tag.x-tag-vrcplus(v-if="userDialog.ref.$isVRCPlus" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRC+ el-tag.name(v-if="userDialog.ref.$customTag" type="info" effect="plain" size="mini" v-text="userDialog.ref.$customTag" :style="{'color':userDialog.ref.$customTagColour, 'border-color':userDialog.ref.$customTagColour}" style="margin-right:5px;margin-top:5px") div(style="margin-top:5px") span(v-text="userDialog.ref.statusDescription" style="font-size:12px") diff --git a/html/src/repository/database.js b/html/src/repository/database.js index e7e505811..1fd913800 100644 --- a/html/src/repository/database.js +++ b/html/src/repository/database.js @@ -8,6 +8,10 @@ class Database { async initUserTables(userId) { Database.userId = userId; Database.userPrefix = userId.replaceAll('-', '').replaceAll('_', ''); + // Fix escape, add underscore if prefix starts with a number + if (Database.userPrefix.match(/^\d/)) { + Database.userPrefix = '_' + Database.userPrefix; + } await sqliteService.executeNonQuery( `CREATE TABLE IF NOT EXISTS ${Database.userPrefix}_feed_gps (id INTEGER PRIMARY KEY, created_at TEXT, user_id TEXT, display_name TEXT, location TEXT, world_name TEXT, previous_location TEXT, time INTEGER, group_name TEXT)` );