mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Group blocking
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@
|
|||||||
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
|
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
|
||||||
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
|
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
|
||||||
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.118" />
|
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.118" />
|
||||||
<PackageReference Include="System.Drawing.Common" Version="8.0.5" />
|
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
|
||||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||||
<PackageReference Include="System.Text.Json" Version="8.0.3" />
|
<PackageReference Include="System.Text.Json" Version="8.0.3" />
|
||||||
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
|
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
|
||||||
|
|||||||
@@ -29051,6 +29051,98 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$app.methods.blockGroup = function (groupId) {
|
||||||
|
this.$confirm('Are you sure you want to block this group?', 'Confirm', {
|
||||||
|
confirmButtonText: 'Confirm',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
type: 'info',
|
||||||
|
callback: (action) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
API.blockGroup({
|
||||||
|
groupId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.unblockGroup = function (groupId) {
|
||||||
|
this.$confirm(
|
||||||
|
'Are you sure you want to unblock this group?',
|
||||||
|
'Confirm',
|
||||||
|
{
|
||||||
|
confirmButtonText: 'Confirm',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
type: 'info',
|
||||||
|
callback: (action) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
API.unblockGroup({
|
||||||
|
groupId,
|
||||||
|
userId: API.currentUser.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
groupId: string
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
API.blockGroup = function (params) {
|
||||||
|
return this.call(`groups/${params.groupId}/block`, {
|
||||||
|
method: 'POST'
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
this.$emit('GROUP:BLOCK', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
groupId: string,
|
||||||
|
userId: string
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
API.unblockGroup = function (params) {
|
||||||
|
return this.call(`groups/${params.groupId}/members/${params.userId}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
this.$emit('GROUP:UNBLOCK', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
API.$on('GROUP:BLOCK', function (args) {
|
||||||
|
if (
|
||||||
|
$app.groupDialog.visible &&
|
||||||
|
$app.groupDialog.id === args.params.groupId
|
||||||
|
) {
|
||||||
|
$app.showGroupDialog(args.params.groupId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
API.$on('GROUP:UNBLOCK', function (args) {
|
||||||
|
if (
|
||||||
|
$app.groupDialog.visible &&
|
||||||
|
$app.groupDialog.id === args.params.groupId
|
||||||
|
) {
|
||||||
|
$app.showGroupDialog(args.params.groupId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {{
|
* @param {{
|
||||||
groupId: string,
|
groupId: string,
|
||||||
@@ -30116,6 +30208,12 @@ speechSynthesis.getVoices();
|
|||||||
case 'Leave Group':
|
case 'Leave Group':
|
||||||
this.leaveGroup(D.id);
|
this.leaveGroup(D.id);
|
||||||
break;
|
break;
|
||||||
|
case 'Block Group':
|
||||||
|
this.blockGroup(D.id);
|
||||||
|
break;
|
||||||
|
case 'Unblock Group':
|
||||||
|
this.unblockGroup(D.id);
|
||||||
|
break;
|
||||||
case 'Visibility Everyone':
|
case 'Visibility Everyone':
|
||||||
this.setGroupVisibility(D.id, 'visible');
|
this.setGroupVisibility(D.id, 'visible');
|
||||||
break;
|
break;
|
||||||
|
|||||||
+9
-3
@@ -236,8 +236,11 @@ html
|
|||||||
div(v-for="displayName in userDialog.previousDisplayNames" placement="top")
|
div(v-for="displayName in userDialog.previousDisplayNames" placement="top")
|
||||||
span(v-text="displayName")
|
span(v-text="displayName")
|
||||||
i.el-icon-caret-bottom
|
i.el-icon-caret-bottom
|
||||||
span.dialog-title(v-text="userDialog.ref.displayName" style="margin-left:5px;margin-right:5px")
|
el-popover(placement="top" trigger="click")
|
||||||
span(v-if="userDialog.ref.pronouns" v-text="userDialog.ref.pronouns" style="margin-right:5px;color:#909399;font-family:monospace;font-size:12px")
|
span.dialog-title(slot="reference" v-text="userDialog.ref.displayName" style="margin-left:5px;margin-right:5px;cursor:pointer")
|
||||||
|
span(style="display:block;text-align:center;font-family:monospace") {{ API.currentUser.username | textToHex }}
|
||||||
|
el-tooltip(v-if="userDialog.ref.pronouns" placement="top" :content="$t('dialog.user.pronouns')" :disabled="hideTooltips")
|
||||||
|
span(v-text="userDialog.ref.pronouns" style="margin-right:5px;color:#909399;font-family:monospace;font-size:12px")
|
||||||
el-tooltip(v-for="item in userDialog.ref.$languages" :key="item.key" placement="top")
|
el-tooltip(v-for="item in userDialog.ref.$languages" :key="item.key" placement="top")
|
||||||
template(#content)
|
template(#content)
|
||||||
span {{ item.value }} ({{ item.key }})
|
span {{ item.value }} ({{ item.key }})
|
||||||
@@ -1009,7 +1012,7 @@ html
|
|||||||
el-tooltip(v-if="groupDialog.ref.joinState === 'open'" placement="top" :content="$t('dialog.group.actions.join_group_tooltip')" :disabled="hideTooltips")
|
el-tooltip(v-if="groupDialog.ref.joinState === 'open'" placement="top" :content="$t('dialog.group.actions.join_group_tooltip')" :disabled="hideTooltips")
|
||||||
el-button(type="default" icon="el-icon-check" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
|
el-button(type="default" icon="el-icon-check" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
|
||||||
el-dropdown(trigger="click" @command="groupDialogCommand" size="small" style="margin-left:5px")
|
el-dropdown(trigger="click" @command="groupDialogCommand" size="small" style="margin-left:5px")
|
||||||
el-button(type="default" icon="el-icon-more" circle)
|
el-button(:type="groupDialog.ref.membershipStatus === 'userblocked' ? 'danger' : 'default'" icon="el-icon-more" circle)
|
||||||
el-dropdown-menu(#default="dropdown")
|
el-dropdown-menu(#default="dropdown")
|
||||||
el-dropdown-item(icon="el-icon-refresh" command="Refresh") {{ $t('dialog.group.actions.refresh') }}
|
el-dropdown-item(icon="el-icon-refresh" command="Refresh") {{ $t('dialog.group.actions.refresh') }}
|
||||||
template(v-if="groupDialog.inGroup")
|
template(v-if="groupDialog.inGroup")
|
||||||
@@ -1026,6 +1029,9 @@ html
|
|||||||
el-dropdown-item(icon="el-icon-view" command="Visibility Friends") #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'friends'")] {{ $t('dialog.group.actions.visibility_friends') }}
|
el-dropdown-item(icon="el-icon-view" command="Visibility Friends") #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'friends'")] {{ $t('dialog.group.actions.visibility_friends') }}
|
||||||
el-dropdown-item(icon="el-icon-view" command="Visibility Hidden") #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'hidden'")] {{ $t('dialog.group.actions.visibility_hidden') }}
|
el-dropdown-item(icon="el-icon-view" command="Visibility Hidden") #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'hidden'")] {{ $t('dialog.group.actions.visibility_hidden') }}
|
||||||
el-dropdown-item(icon="el-icon-delete" command="Leave Group" style="color:#F56C6C" divided) {{ $t('dialog.group.actions.leave') }}
|
el-dropdown-item(icon="el-icon-delete" command="Leave Group" style="color:#F56C6C" divided) {{ $t('dialog.group.actions.leave') }}
|
||||||
|
template(v-else)
|
||||||
|
el-dropdown-item(v-if="groupDialog.ref.membershipStatus === 'userblocked'" icon="el-icon-circle-check" command="Unblock Group" style="color:#F56C6C" divided) {{ $t('dialog.group.actions.unblock') }}
|
||||||
|
el-dropdown-item(v-else icon="el-icon-circle-close" command="Block Group" divided) {{ $t('dialog.group.actions.block') }}
|
||||||
el-tabs(ref="groupDialogTabs" @tab-click="groupDialogTabClick")
|
el-tabs(ref="groupDialogTabs" @tab-click="groupDialogTabClick")
|
||||||
el-tab-pane(:label="$t('dialog.group.info.header')")
|
el-tab-pane(:label="$t('dialog.group.info.header')")
|
||||||
.group-banner-image-info
|
.group-banner-image-info
|
||||||
|
|||||||
@@ -543,9 +543,10 @@
|
|||||||
"online": "Online",
|
"online": "Online",
|
||||||
"join_me": "Join Me",
|
"join_me": "Join Me",
|
||||||
"ask_me": "Ask Me",
|
"ask_me": "Ask Me",
|
||||||
"busy": "Do Not Disturb"
|
"busy": "Busy"
|
||||||
},
|
},
|
||||||
"previous_display_names": "Previous Display Names:",
|
"previous_display_names": "Previous Display Names:",
|
||||||
|
"pronouns": "Pronouns",
|
||||||
"tags": {
|
"tags": {
|
||||||
"friend_no": "Friend No.{number}",
|
"friend_no": "Friend No.{number}",
|
||||||
"vrchat_team": "VRChat Team"
|
"vrchat_team": "VRChat Team"
|
||||||
@@ -837,7 +838,9 @@
|
|||||||
"visibility_hidden": "Visibility Hidden",
|
"visibility_hidden": "Visibility Hidden",
|
||||||
"create_post": "Create Post",
|
"create_post": "Create Post",
|
||||||
"moderation_tools": "Moderation Tools",
|
"moderation_tools": "Moderation Tools",
|
||||||
"leave": "Leave Group"
|
"leave": "Leave Group",
|
||||||
|
"block": "Block Group",
|
||||||
|
"unblock": "Unblock Group"
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
"header": "Info",
|
"header": "Info",
|
||||||
|
|||||||
Reference in New Issue
Block a user