mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
quick invite yourself
This commit is contained in:
@@ -662,6 +662,63 @@ CefSharp.BindObjectAsync(
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('invite-yourself', {
|
||||
template: '<el-button @click="confirm" size="mini" icon="el-icon-message" circle></el-button>',
|
||||
props: {
|
||||
location: String
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
var L = API.parseLocation(this.location);
|
||||
this.$el.style.display = L.isOffline || L.isPrivate
|
||||
? 'none'
|
||||
: '';
|
||||
},
|
||||
confirm() {
|
||||
var L = API.parseLocation(this.location);
|
||||
if (L.isOffline ||
|
||||
L.isPrivate ||
|
||||
L.worldId === '') {
|
||||
return;
|
||||
}
|
||||
API.getCachedWorld({
|
||||
worldId: L.worldId
|
||||
}).then((args) => {
|
||||
var params = {
|
||||
receiverUserId: API.currentUser.id,
|
||||
type: 'invite',
|
||||
message: 'This is a generated invite',
|
||||
seen: false,
|
||||
details: {
|
||||
worldId: L.tag,
|
||||
worldName: args.ref.name
|
||||
}
|
||||
};
|
||||
if (API.currentUser.status === 'busy') {
|
||||
this.$message({
|
||||
message: 'You can\'t invite yourself in \'Do Not Disturb\' mode',
|
||||
type: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
API.sendNotification(params).finally(() => {
|
||||
this.$message({
|
||||
message: 'Invite sent to yourself',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
location() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('location', {
|
||||
template: '<span @click="showWorldDialog" :class="{ \'x-link\': link }">{{ text }}<slot></slot></span>',
|
||||
|
||||
@@ -694,6 +694,7 @@ html
|
||||
location(:location="userDialog.ref.location")
|
||||
template(#default v-if="userDialog.instance.occupants") ({{ userDialog.instance.occupants }})
|
||||
launch(:location="userDialog.ref.location" style="margin-left:5px")
|
||||
invite-yourself(:location="userDialog.ref.location" style="margin-left:5px")
|
||||
.x-friend-list(style="flex:1;margin-top:10px")
|
||||
.x-friend-item(v-if="userDialog.$location.userId" @click="showUserDialog(userDialog.$location.userId)")
|
||||
template(v-if="userDialog.$location.user")
|
||||
@@ -810,6 +811,7 @@ html
|
||||
div(style="margin:5px 0")
|
||||
span.x-link(@click="showLaunchDialog(room.$location.tag)").
|
||||
\#{{ room.$location.instanceName }} {{ room.$location.accessType }} #[template(v-if="room.occupants") ({{ room.occupants }})]
|
||||
invite-yourself(:location="room.$location.tag" style="margin-left:5px")
|
||||
.x-friend-list(style="margin:10px 0" v-if="room.$location.userId || room.users.length")
|
||||
.x-friend-item(v-if="room.$location.userId" @click="showUserDialog(room.$location.userId)")
|
||||
template(v-if="room.$location.user")
|
||||
|
||||
Reference in New Issue
Block a user