Trim direct access input

This commit is contained in:
Natsumi
2023-04-11 02:52:06 +12:00
parent 8baa43a57e
commit f6b68c33f5
2 changed files with 23 additions and 10 deletions

View File

@@ -1723,6 +1723,9 @@ speechSynthesis.getVoices();
var tag = $app.customUserTags.get(json.id);
ref.$customTag = tag.tag;
ref.$customTagColour = tag.colour;
} else if (ref.$customTag) {
ref.$customTag = '';
ref.$customTagColour = '';
}
ref.$isVRCPlus = ref.tags.includes('system_supporter');
this.applyUserTrustLevel(ref);
@@ -14066,7 +14069,7 @@ speechSynthesis.getVoices();
inputErrorMessage: $t('prompt.direct_access_omni.input_error'),
callback: (action, instance) => {
if (action === 'confirm' && instance.inputValue) {
var input = instance.inputValue;
var input = instance.inputValue.trim();
if (!this.directAccessParse(input)) {
this.$message({
message: $t(
@@ -14083,7 +14086,7 @@ speechSynthesis.getVoices();
$app.methods.directAccessPaste = function () {
AppApi.GetClipboard().then((clipboard) => {
if (!this.directAccessParse(clipboard)) {
if (!this.directAccessParse(clipboard.trim())) {
this.promptOmniDirectDialog();
}
});
@@ -14153,7 +14156,7 @@ speechSynthesis.getVoices();
if (!input) {
return false;
}
if (this.directAccessWorld(input.trim())) {
if (this.directAccessWorld(input)) {
return true;
}
if (input.startsWith('https://vrchat.')) {
@@ -14190,13 +14193,13 @@ speechSynthesis.getVoices();
input.substring(0, 4) === 'usr_' ||
/^[A-Za-z0-9]{10}$/g.test(input)
) {
this.showUserDialog(input.trim());
this.showUserDialog(input);
return true;
} else if (input.substring(0, 5) === 'avtr_') {
this.showAvatarDialog(input.trim());
this.showAvatarDialog(input);
return true;
} else if (input.substring(0, 4) === 'grp_') {
this.showGroupDialog(input.trim());
this.showGroupDialog(input);
return true;
}
return false;
@@ -21729,6 +21732,9 @@ speechSynthesis.getVoices();
this.photonLastEvent7List = Date.parse(data.dt);
break;
case 'VrcxMessage':
if (this.debugPhotonLogging) {
console.log('VrcxMessage:', data);
}
this.eventVrcxMessage(data);
break;
case 'Ping':
@@ -21800,6 +21806,16 @@ speechSynthesis.getVoices();
case 'CustomTag':
this.addCustomTag(data);
break;
case 'ClearCustomTags':
this.customUserTags.forEach((value, key) => {
this.customUserTags.delete(key);
var ref = API.cachedUsers.get(key);
if (typeof ref !== 'undefined') {
ref.$customTag = '';
ref.$customTagColour = '';
}
});
break;
case 'Noty':
var entry = {
created_at: new Date().toJSON(),
@@ -21809,9 +21825,6 @@ speechSynthesis.getVoices();
database.addGamelogEventToDatabase(entry);
this.queueGameLogNoty(entry);
this.addGameLog(entry);
if (data.Tag) {
this.addCustomTag(data);
}
break;
default:
console.log('VRCXMessage:', data);

View File

@@ -204,7 +204,7 @@
},
"game_log": {
"header": "Game Log",
"resource_load": "Log Resource Load entries"
"resource_load": "Log Udon resource load"
},
"legal_notice": {
"header": "Legal Notice",