mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Upload invite photos
This commit is contained in:
+292
-93
@@ -2071,6 +2071,21 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.sendInvitePhoto = function (params, receiverUserId) {
|
||||||
|
return this.call(`invite/${receiverUserId}/photo`, {
|
||||||
|
uploadImage: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData: $app.uploadImage
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
this.$emit('NOTIFICATION:INVITE:PHOTO:SEND', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
API.sendRequestInvite = function (params, receiverUserId) {
|
API.sendRequestInvite = function (params, receiverUserId) {
|
||||||
return this.call(`requestInvite/${receiverUserId}`, {
|
return this.call(`requestInvite/${receiverUserId}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -2085,6 +2100,52 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.sendRequestInvitePhoto = function (params, receiverUserId) {
|
||||||
|
return this.call(`requestInvite/${receiverUserId}/photo`, {
|
||||||
|
uploadImage: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData: $app.uploadImage
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
this.$emit('NOTIFICATION:REQUESTINVITE:PHOTO:SEND', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
API.sendInviteResponse = function (params, inviteID) {
|
||||||
|
return this.call(`invite/${inviteID}/response`, {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params,
|
||||||
|
inviteID
|
||||||
|
};
|
||||||
|
this.$emit('INVITE:RESPONSE:SEND', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
API.sendInviteResponsePhoto = function (params, inviteID) {
|
||||||
|
return this.call(`invite/${inviteID}/response/photo`, {
|
||||||
|
uploadImage: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData: $app.uploadImage
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params,
|
||||||
|
inviteID
|
||||||
|
};
|
||||||
|
this.$emit('INVITE:RESPONSE:PHOTO:SEND', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
params: {
|
params: {
|
||||||
notificationId: string
|
notificationId: string
|
||||||
@@ -4051,6 +4112,9 @@ speechSynthesis.getVoices();
|
|||||||
message = noty.details[messageList[i]];
|
message = noty.details[messageList[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (message) {
|
||||||
|
message = `, ${message}`;
|
||||||
|
}
|
||||||
if ((this.notificationTTS) && (this.isGameRunning)) {
|
if ((this.notificationTTS) && (this.isGameRunning)) {
|
||||||
this.playNotyTTS(noty, message);
|
this.playNotyTTS(noty, message);
|
||||||
}
|
}
|
||||||
@@ -4086,16 +4150,16 @@ speechSynthesis.getVoices();
|
|||||||
this.speak(`${noty.displayName} status is now ${noty.status[0].status} ${noty.status[0].statusDescription}`);
|
this.speak(`${noty.displayName} status is now ${noty.status[0].status} ${noty.status[0].statusDescription}`);
|
||||||
break;
|
break;
|
||||||
case 'invite':
|
case 'invite':
|
||||||
this.speak(`${noty.senderUsername} has invited you to ${noty.details.worldName} ${message}`);
|
this.speak(`${noty.senderUsername} has invited you to ${noty.details.worldName}${message}`);
|
||||||
break;
|
break;
|
||||||
case 'requestInvite':
|
case 'requestInvite':
|
||||||
this.speak(`${noty.senderUsername} has requested an invite ${message}`);
|
this.speak(`${noty.senderUsername} has requested an invite${message}`);
|
||||||
break;
|
break;
|
||||||
case 'inviteResponse':
|
case 'inviteResponse':
|
||||||
this.speak(`${noty.senderUsername} has responded to your invite ${message}`);
|
this.speak(`${noty.senderUsername} has responded to your invite${message}`);
|
||||||
break;
|
break;
|
||||||
case 'requestInviteResponse':
|
case 'requestInviteResponse':
|
||||||
this.speak(`${noty.senderUsername} has responded to your invite request ${message}`);
|
this.speak(`${noty.senderUsername} has responded to your invite request${message}`);
|
||||||
break;
|
break;
|
||||||
case 'friendRequest':
|
case 'friendRequest':
|
||||||
this.speak(`${noty.senderUsername} has sent you a friend request`);
|
this.speak(`${noty.senderUsername} has sent you a friend request`);
|
||||||
@@ -4149,7 +4213,9 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (userId) {
|
if ((noty.details) && (noty.details.imageUrl)) {
|
||||||
|
imageURL = noty.details.imageUrl;
|
||||||
|
} else if (userId) {
|
||||||
imageURL = await API.getCachedUser({
|
imageURL = await API.getCachedUser({
|
||||||
userId: userId
|
userId: userId
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
@@ -4184,16 +4250,16 @@ speechSynthesis.getVoices();
|
|||||||
AppApi.DesktopNotification(noty.displayName, `status is now ${noty.status[0].status} ${noty.status[0].statusDescription}`, imageURL);
|
AppApi.DesktopNotification(noty.displayName, `status is now ${noty.status[0].status} ${noty.status[0].statusDescription}`, imageURL);
|
||||||
break;
|
break;
|
||||||
case 'invite':
|
case 'invite':
|
||||||
AppApi.DesktopNotification(noty.senderUsername, `has invited you to ${noty.details.worldName} ${message}`, imageURL);
|
AppApi.DesktopNotification(noty.senderUsername, `has invited you to ${noty.details.worldName}${message}`, imageURL);
|
||||||
break;
|
break;
|
||||||
case 'requestInvite':
|
case 'requestInvite':
|
||||||
AppApi.DesktopNotification(noty.senderUsername, `has requested an invite ${message}`, imageURL);
|
AppApi.DesktopNotification(noty.senderUsername, `has requested an invite${message}`, imageURL);
|
||||||
break;
|
break;
|
||||||
case 'inviteResponse':
|
case 'inviteResponse':
|
||||||
AppApi.DesktopNotification(noty.senderUsername, `has responded to your invite ${message}`, imageURL);
|
AppApi.DesktopNotification(noty.senderUsername, `has responded to your invite${message}`, imageURL);
|
||||||
break;
|
break;
|
||||||
case 'requestInviteResponse':
|
case 'requestInviteResponse':
|
||||||
AppApi.DesktopNotification(noty.senderUsername, `has responded to your invite request ${message}`, imageURL);
|
AppApi.DesktopNotification(noty.senderUsername, `has responded to your invite request${message}`, imageURL);
|
||||||
break;
|
break;
|
||||||
case 'friendRequest':
|
case 'friendRequest':
|
||||||
AppApi.DesktopNotification(noty.senderUsername, 'has sent you a friend request', imageURL);
|
AppApi.DesktopNotification(noty.senderUsername, 'has sent you a friend request', imageURL);
|
||||||
@@ -8782,6 +8848,41 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.data.uploadImage = '';
|
||||||
|
|
||||||
|
$app.methods.inviteImageUpload = function (e) {
|
||||||
|
var files = e.target.files || e.dataTransfer.files;
|
||||||
|
if (!files.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (files[0].size >= 10485760) { //10MB
|
||||||
|
$app.$message({
|
||||||
|
message: 'File size too large',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!files[0].type.match(/image.*/)) {
|
||||||
|
$app.$message({
|
||||||
|
message: 'File isn\'t an image',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var r = new FileReader();
|
||||||
|
r.onload = function () {
|
||||||
|
$app.uploadImage = btoa(r.result);
|
||||||
|
};
|
||||||
|
r.readAsBinaryString(files[0]);
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.clearInviteImageUpload = function () {
|
||||||
|
if (document.querySelector('#InviteImageUploadButton')) {
|
||||||
|
document.querySelector('#InviteImageUploadButton').value = '';
|
||||||
|
}
|
||||||
|
this.uploadImage = '';
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.userOnlineFor = function (ctx) {
|
$app.methods.userOnlineFor = function (ctx) {
|
||||||
if ((ctx.ref.state === 'online') && (ctx.ref.$online_for)) {
|
if ((ctx.ref.state === 'online') && (ctx.ref.$online_for)) {
|
||||||
return timeToText(Date.now() - ctx.ref.$online_for);
|
return timeToText(Date.now() - ctx.ref.$online_for);
|
||||||
@@ -8883,10 +8984,17 @@ speechSynthesis.getVoices();
|
|||||||
API.editInviteMessage(params, messageType, slot).catch((err) => {
|
API.editInviteMessage(params, messageType, slot).catch((err) => {
|
||||||
throw err;
|
throw err;
|
||||||
}).then((args) => {
|
}).then((args) => {
|
||||||
this.$message('Invite message updated');
|
API.$emit(`INVITE:${messageType.toUpperCase()}`, args);
|
||||||
|
if (args.json[slot].message !== D.newMessage) {
|
||||||
|
this.$message({
|
||||||
|
message: 'VRChat API didn\'t update message, try again',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
throw new Error('VRChat API didn\'t update message, try again');
|
||||||
|
} else {
|
||||||
|
this.$message('Invite message updated');
|
||||||
|
}
|
||||||
return args;
|
return args;
|
||||||
}).finally(() => {
|
|
||||||
API.refreshInviteMessageTableData(messageType);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -8926,7 +9034,7 @@ speechSynthesis.getVoices();
|
|||||||
await API.editInviteMessage(params, messageType, slot).catch((err) => {
|
await API.editInviteMessage(params, messageType, slot).catch((err) => {
|
||||||
throw err;
|
throw err;
|
||||||
}).then((args) => {
|
}).then((args) => {
|
||||||
this.$emit(`INVITE:${messageType.toUpperCase()}`, args);
|
API.$emit(`INVITE:${messageType.toUpperCase()}`, args);
|
||||||
if (args.json[slot].message !== D.newMessage) {
|
if (args.json[slot].message !== D.newMessage) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'VRChat API didn\'t update message, try again',
|
message: 'VRChat API didn\'t update message, try again',
|
||||||
@@ -8944,20 +9052,37 @@ speechSynthesis.getVoices();
|
|||||||
responseSlot: slot,
|
responseSlot: slot,
|
||||||
rsvp: true
|
rsvp: true
|
||||||
};
|
};
|
||||||
API.sendInviteResponse(params, I.invite.id).catch((err) => {
|
if ($app.uploadImage) {
|
||||||
throw err;
|
API.sendInviteResponsePhoto(params, I.invite.id).catch((err) => {
|
||||||
}).then((args) => {
|
throw err;
|
||||||
API.hideNotification({
|
}).then((args) => {
|
||||||
notificationId: I.invite.id
|
API.hideNotification({
|
||||||
|
notificationId: I.invite.id
|
||||||
|
});
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite response message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
this.sendInviteResponseDialogVisible = false;
|
||||||
|
this.sendInviteRequestResponseDialogVisible = false;
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
this.$message({
|
} else {
|
||||||
message: 'Invite response message sent',
|
API.sendInviteResponse(params, I.invite.id).catch((err) => {
|
||||||
type: 'success'
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
API.hideNotification({
|
||||||
|
notificationId: I.invite.id
|
||||||
|
});
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite response message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
this.sendInviteResponseDialogVisible = false;
|
||||||
|
this.sendInviteRequestResponseDialogVisible = false;
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
this.sendInviteResponseDialogVisible = false;
|
}
|
||||||
this.sendInviteRequestResponseDialogVisible = false;
|
|
||||||
return args;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.cancelEditAndSendInviteResponse = function () {
|
$app.methods.cancelEditAndSendInviteResponse = function () {
|
||||||
@@ -8987,6 +9112,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
API.refreshInviteMessageTableData('response');
|
API.refreshInviteMessageTableData('response');
|
||||||
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteResponseDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteResponseDialog.$el));
|
||||||
|
this.clearInviteImageUpload();
|
||||||
this.sendInviteResponseDialogVisible = true;
|
this.sendInviteResponseDialogVisible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -9013,38 +9139,38 @@ speechSynthesis.getVoices();
|
|||||||
responseSlot: D.messageSlot,
|
responseSlot: D.messageSlot,
|
||||||
rsvp: true
|
rsvp: true
|
||||||
};
|
};
|
||||||
API.sendInviteResponse(params, D.invite.id, D.messageType).catch((err) => {
|
if ($app.uploadImage) {
|
||||||
throw err;
|
API.sendInviteResponsePhoto(params, D.invite.id, D.messageType).catch((err) => {
|
||||||
}).then((args) => {
|
throw err;
|
||||||
API.hideNotification({
|
}).then((args) => {
|
||||||
notificationId: D.invite.id
|
API.hideNotification({
|
||||||
|
notificationId: D.invite.id
|
||||||
|
});
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite response photo message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
this.$message({
|
} else {
|
||||||
message: 'Invite response message sent',
|
API.sendInviteResponse(params, D.invite.id, D.messageType).catch((err) => {
|
||||||
type: 'success'
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
API.hideNotification({
|
||||||
|
notificationId: D.invite.id
|
||||||
|
});
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite response message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
return args;
|
}
|
||||||
});
|
|
||||||
this.sendInviteResponseDialogVisible = false;
|
this.sendInviteResponseDialogVisible = false;
|
||||||
this.sendInviteRequestResponseDialogVisible = false;
|
this.sendInviteRequestResponseDialogVisible = false;
|
||||||
this.sendInviteResponseConfirmDialog.visible = false;
|
this.sendInviteResponseConfirmDialog.visible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
API.sendInviteResponse = function (params, inviteID) {
|
|
||||||
return this.call(`invite/${inviteID}/response`, {
|
|
||||||
method: 'POST',
|
|
||||||
params
|
|
||||||
}).then((json) => {
|
|
||||||
var args = {
|
|
||||||
json,
|
|
||||||
params,
|
|
||||||
inviteID
|
|
||||||
};
|
|
||||||
this.$emit('INVITE:RESPONSE:SEND', args);
|
|
||||||
return args;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// App: Invite Request Response Message Dialog
|
// App: Invite Request Response Message Dialog
|
||||||
|
|
||||||
$app.data.sendInviteRequestResponseDialogVisible = false;
|
$app.data.sendInviteRequestResponseDialogVisible = false;
|
||||||
@@ -9064,6 +9190,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
API.refreshInviteMessageTableData('requestResponse');
|
API.refreshInviteMessageTableData('requestResponse');
|
||||||
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteRequestResponseDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteRequestResponseDialog.$el));
|
||||||
|
this.clearInviteImageUpload();
|
||||||
this.sendInviteRequestResponseDialogVisible = true;
|
this.sendInviteRequestResponseDialogVisible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -9098,7 +9225,7 @@ speechSynthesis.getVoices();
|
|||||||
await API.editInviteMessage(params, messageType, slot).catch((err) => {
|
await API.editInviteMessage(params, messageType, slot).catch((err) => {
|
||||||
throw err;
|
throw err;
|
||||||
}).then((args) => {
|
}).then((args) => {
|
||||||
this.$emit(`INVITE:${messageType.toUpperCase()}`, args);
|
API.$emit(`INVITE:${messageType.toUpperCase()}`, args);
|
||||||
if (args.json[slot].message !== D.newMessage) {
|
if (args.json[slot].message !== D.newMessage) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'VRChat API didn\'t update message, try again',
|
message: 'VRChat API didn\'t update message, try again',
|
||||||
@@ -9125,12 +9252,21 @@ speechSynthesis.getVoices();
|
|||||||
var inviteLoop = () => {
|
var inviteLoop = () => {
|
||||||
if (J.userIds.length > 0) {
|
if (J.userIds.length > 0) {
|
||||||
var receiverUserId = J.userIds.shift();
|
var receiverUserId = J.userIds.shift();
|
||||||
API.sendInvite({
|
if ($app.uploadImage) {
|
||||||
instanceId: J.worldId,
|
API.sendInvitePhoto({
|
||||||
worldId: J.worldId,
|
instanceId: J.worldId,
|
||||||
worldName: J.worldName,
|
worldId: J.worldId,
|
||||||
messageSlot: slot
|
worldName: J.worldName,
|
||||||
}, receiverUserId).finally(inviteLoop);
|
messageSlot: slot
|
||||||
|
}, receiverUserId).finally(inviteLoop);
|
||||||
|
} else {
|
||||||
|
API.sendInvite({
|
||||||
|
instanceId: J.worldId,
|
||||||
|
worldId: J.worldId,
|
||||||
|
worldName: J.worldName,
|
||||||
|
messageSlot: slot
|
||||||
|
}, receiverUserId).finally(inviteLoop);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
J.loading = false;
|
J.loading = false;
|
||||||
J.visible = false;
|
J.visible = false;
|
||||||
@@ -9144,26 +9280,51 @@ speechSynthesis.getVoices();
|
|||||||
} else {
|
} else {
|
||||||
if (I.messageType === 'invite') {
|
if (I.messageType === 'invite') {
|
||||||
I.params.messageSlot = slot;
|
I.params.messageSlot = slot;
|
||||||
API.sendInvite(I.params, I.userId).catch((err) => {
|
if ($app.uploadImage) {
|
||||||
throw err;
|
API.sendInvitePhoto(I.params, I.userId).catch((err) => {
|
||||||
}).then((args) => {
|
throw err;
|
||||||
this.$message({
|
}).then((args) => {
|
||||||
message: 'Invite message sent',
|
this.$message({
|
||||||
type: 'success'
|
message: 'Invite photo message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
return args;
|
} else {
|
||||||
});
|
API.sendInvite(I.params, I.userId).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
} else if (I.messageType === 'requestInvite') {
|
} else if (I.messageType === 'requestInvite') {
|
||||||
I.params.requestSlot = slot;
|
I.params.requestSlot = slot;
|
||||||
API.sendRequestInvite(I.params, I.userId).catch((err) => {
|
if ($app.uploadImage) {
|
||||||
throw err;
|
API.sendRequestInvitePhoto(I.params, I.userId).catch((err) => {
|
||||||
}).then((args) => {
|
this.clearInviteImageUpload();
|
||||||
this.$message({
|
throw err;
|
||||||
message: 'Request invite message sent',
|
}).then((args) => {
|
||||||
type: 'success'
|
this.$message({
|
||||||
|
message: 'Request invite photo message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
return args;
|
} else {
|
||||||
});
|
API.sendRequestInvite(I.params, I.userId).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Request invite message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sendInviteDialogVisible = false;
|
this.sendInviteDialogVisible = false;
|
||||||
@@ -9201,6 +9362,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
API.refreshInviteMessageTableData('message');
|
API.refreshInviteMessageTableData('message');
|
||||||
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteDialog.$el));
|
||||||
|
this.clearInviteImageUpload();
|
||||||
this.sendInviteDialogVisible = true;
|
this.sendInviteDialogVisible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -9236,12 +9398,21 @@ speechSynthesis.getVoices();
|
|||||||
var inviteLoop = () => {
|
var inviteLoop = () => {
|
||||||
if (J.userIds.length > 0) {
|
if (J.userIds.length > 0) {
|
||||||
var receiverUserId = J.userIds.shift();
|
var receiverUserId = J.userIds.shift();
|
||||||
API.sendInvite({
|
if ($app.uploadImage) {
|
||||||
instanceId: J.worldId,
|
API.sendInvitePhoto({
|
||||||
worldId: J.worldId,
|
instanceId: J.worldId,
|
||||||
worldName: J.worldName,
|
worldId: J.worldId,
|
||||||
messageSlot: D.messageSlot
|
worldName: J.worldName,
|
||||||
}, receiverUserId).finally(inviteLoop);
|
messageSlot: D.messageSlot
|
||||||
|
}, receiverUserId).finally(inviteLoop);
|
||||||
|
} else {
|
||||||
|
API.sendInvite({
|
||||||
|
instanceId: J.worldId,
|
||||||
|
worldId: J.worldId,
|
||||||
|
worldName: J.worldName,
|
||||||
|
messageSlot: D.messageSlot
|
||||||
|
}, receiverUserId).finally(inviteLoop);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
J.loading = false;
|
J.loading = false;
|
||||||
J.visible = false;
|
J.visible = false;
|
||||||
@@ -9255,24 +9426,51 @@ speechSynthesis.getVoices();
|
|||||||
} else {
|
} else {
|
||||||
if (D.messageType === 'invite') {
|
if (D.messageType === 'invite') {
|
||||||
D.params.messageSlot = D.messageSlot;
|
D.params.messageSlot = D.messageSlot;
|
||||||
API.sendInvite(D.params, D.userId).catch((err) => {
|
if ($app.uploadImage) {
|
||||||
throw err;
|
API.sendInvitePhoto(D.params, D.userId).catch((err) => {
|
||||||
}).then((args) => {
|
throw err;
|
||||||
this.$message({
|
}).then((args) => {
|
||||||
message: 'Invite message sent',
|
this.$message({
|
||||||
type: 'success'
|
message: 'Invite photo message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
return args;
|
} else {
|
||||||
});
|
API.sendInvite(D.params, D.userId).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
} else if (D.messageType === 'requestInvite') {
|
} else if (D.messageType === 'requestInvite') {
|
||||||
D.params.requestSlot = D.messageSlot;
|
D.params.requestSlot = D.messageSlot;
|
||||||
API.sendRequestInvite(D.params, D.userId).then((args) => {
|
if ($app.uploadImage) {
|
||||||
this.$message({
|
API.sendRequestInvitePhoto(D.params, D.userId).catch((err) => {
|
||||||
message: 'Request invite message sent',
|
this.clearInviteImageUpload();
|
||||||
type: 'success'
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Request invite photo message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
return args;
|
} else {
|
||||||
});
|
API.sendRequestInvite(D.params, D.userId).catch((err) => {
|
||||||
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Request invite message sent',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sendInviteDialogVisible = false;
|
this.sendInviteDialogVisible = false;
|
||||||
@@ -9301,6 +9499,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
API.refreshInviteMessageTableData('request');
|
API.refreshInviteMessageTableData('request');
|
||||||
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteRequestDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.sendInviteRequestDialog.$el));
|
||||||
|
this.clearInviteImageUpload();
|
||||||
this.sendInviteRequestDialogVisible = true;
|
this.sendInviteRequestDialogVisible = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+15
-6
@@ -536,12 +536,13 @@ html
|
|||||||
template(#content)
|
template(#content)
|
||||||
span Clear results
|
span Clear results
|
||||||
el-button(type="default" @click="VRCPlusIconsTable = {}" size="mini" icon="el-icon-delete" circle style="margin-left:0")
|
el-button(type="default" @click="VRCPlusIconsTable = {}" size="mini" icon="el-icon-delete" circle style="margin-left:0")
|
||||||
el-tooltip(placement="top")
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
template(#content)
|
el-tooltip(placement="top")
|
||||||
span Upload icon
|
template(#content)
|
||||||
div(style="display:inline-block")
|
span Upload icon
|
||||||
el-button(type="default" @click="displayVRCPlusIconUpload" size="mini" icon="el-icon-upload2" circle style="margin-left:0")
|
div(style="display:inline-block")
|
||||||
input(type="file" multiple accept="image/*" @change="onFileChangeVRCPlusIcon" id="VRCPlusIconUploadButton" style="display:none")
|
el-button(type="default" @click="displayVRCPlusIconUpload" size="mini" icon="el-icon-upload2" circle style="margin-left:0")
|
||||||
|
input(type="file" multiple accept="image/*" @change="onFileChangeVRCPlusIcon" id="VRCPlusIconUploadButton" style="display:none")
|
||||||
el-tooltip(placement="top")
|
el-tooltip(placement="top")
|
||||||
template(#content)
|
template(#content)
|
||||||
span Reset icon
|
span Reset icon
|
||||||
@@ -1511,6 +1512,8 @@ html
|
|||||||
|
|
||||||
//- dialog Table: Send Invite Response Message
|
//- dialog Table: Send Invite Response Message
|
||||||
el-dialog.x-dialog(ref="sendInviteResponseDialog" :visible.sync="sendInviteResponseDialogVisible" title="Send Invite Response Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteResponseDialog" :visible.sync="sendInviteResponseDialogVisible" title="Send Invite Response Message" width="800px")
|
||||||
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
|
input(type="file" multiple accept="image/*" @change="inviteImageUpload" id="InviteImageUploadButton")
|
||||||
data-tables(v-bind="inviteResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
@@ -1526,6 +1529,8 @@ html
|
|||||||
|
|
||||||
//- dialog Table: Send Invite Request Response Message
|
//- dialog Table: Send Invite Request Response Message
|
||||||
el-dialog.x-dialog(ref="sendInviteRequestResponseDialog" :visible.sync="sendInviteRequestResponseDialogVisible" title="Send Invite Request Response Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteRequestResponseDialog" :visible.sync="sendInviteRequestResponseDialogVisible" title="Send Invite Request Response Message" width="800px")
|
||||||
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
|
input(type="file" multiple accept="image/*" @change="inviteImageUpload" id="InviteImageUploadButton")
|
||||||
data-tables(v-bind="inviteRequestResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteRequestResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
@@ -1549,6 +1554,8 @@ html
|
|||||||
|
|
||||||
//- dialog Table: Send Invite Message
|
//- dialog Table: Send Invite Message
|
||||||
el-dialog.x-dialog(ref="sendInviteDialog" :visible.sync="sendInviteDialogVisible" title="Send Invite Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteDialog" :visible.sync="sendInviteDialogVisible" title="Send Invite Message" width="800px")
|
||||||
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
|
input(type="file" multiple accept="image/*" @change="inviteImageUpload" id="InviteImageUploadButton")
|
||||||
data-tables(v-bind="inviteMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
@@ -1564,6 +1571,8 @@ html
|
|||||||
|
|
||||||
//- dialog Table: Send Invite Request Message
|
//- dialog Table: Send Invite Request Message
|
||||||
el-dialog.x-dialog(ref="sendInviteRequestDialog" :visible.sync="sendInviteRequestDialogVisible" title="Send Invite Request Message" width="800px")
|
el-dialog.x-dialog(ref="sendInviteRequestDialog" :visible.sync="sendInviteRequestDialogVisible" title="Send Invite Request Message" width="800px")
|
||||||
|
template(v-if="API.currentUser.$isVRCPlus")
|
||||||
|
input(type="file" multiple accept="image/*" @change="inviteImageUpload" id="InviteImageUploadButton")
|
||||||
data-tables(v-bind="inviteRequestMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
data-tables(v-bind="inviteRequestMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||||
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
el-table-column(label="Slot" prop="slot" sortable="custom" width="70")
|
||||||
el-table-column(label="Message" prop="message")
|
el-table-column(label="Message" prop="message")
|
||||||
|
|||||||
Reference in New Issue
Block a user