Bulk unfriend

This commit is contained in:
Natsumi
2022-12-01 20:51:10 +13:00
parent b0c41c6d08
commit 9e92c3b8c7
2 changed files with 103 additions and 6 deletions

View File

@@ -9052,6 +9052,9 @@ speechSynthesis.getVoices();
};
$app.methods.photonBotCheck = function (dtNow) {
if (this.photonLobbyCurrentUser === 0) {
return;
}
var photonBots = [];
this.photonLobbyCurrent.forEach((ref, id) => {
if (this.photonLobbyJointime.has(id)) {
@@ -9337,7 +9340,11 @@ speechSynthesis.getVoices();
joinTime: Date.parse(gameLogDate),
hasInstantiated,
inVRMode: user.inVRMode,
avatarEyeHeight: user.avatarEyeHeight
avatarEyeHeight: user.avatarEyeHeight,
canModerateInstance: user.canModerateInstance,
groupOnNameplate: user.groupOnNameplate,
showGroupBadgeToOthers: user.showGroupBadgeToOthers,
showSocialRank: user.showSocialRank
});
this.photonUserJoin(id, user.avatarDict, gameLogDate);
}
@@ -9429,7 +9436,13 @@ speechSynthesis.getVoices();
joinTime: Date.parse(gameLogDate),
hasInstantiated,
inVRMode: data.Parameters[249].inVRMode,
avatarEyeHeight: data.Parameters[249].avatarEyeHeight
avatarEyeHeight: data.Parameters[249].avatarEyeHeight,
canModerateInstance:
data.Parameters[249].canModerateInstance,
groupOnNameplate: data.Parameters[249].groupOnNameplate,
showGroupBadgeToOthers:
data.Parameters[249].showGroupBadgeToOthers,
showSocialRank: data.Parameters[249].showSocialRank
});
this.photonUserJoin(
data.Parameters[254],
@@ -9900,7 +9913,6 @@ speechSynthesis.getVoices();
var ref = API.cachedUsers.get(user.id);
var photonUser = {
id: user.id,
username: user.username,
displayName: user.displayName,
developerType: user.developerType,
profilePicOverride: user.profilePicOverride,
@@ -17665,8 +17677,76 @@ speechSynthesis.getVoices();
$app.data.friendsListSearch = '';
$app.data.friendsListSearchFilterVIP = false;
$app.data.friendsListSearchFilters = [];
$app.data.friendsListSelectAllCheckbox = false;
$app.data.friendsListBulkUnfriendMode = false;
$app.methods.showBulkUnfriendSelectionConfirm = function () {
var elementsTicked = 0;
for (var ctx of this.friendsListTable.data) {
if (ctx.$selected) {
elementsTicked++;
}
}
if (elementsTicked === 0) {
return;
}
this.$confirm(
`Are you sure you want to delete ${elementsTicked} friends?
This can negatively affect your trust rank,
This action cannot be undone.`,
`Delete ${elementsTicked} friends?`,
{
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'info',
callback: (action) => {
if (action === 'confirm') {
this.bulkUnfriendSelection();
}
}
}
);
};
$app.methods.bulkUnfriendSelection = function () {
for (var ctx of this.friendsListTable.data) {
if (ctx.$selected) {
API.deleteFriend({
userId: ctx.id
});
}
}
};
// $app.methods.showBulkUnfriendAllConfirm = function () {
// this.$confirm(
// `Are you sure you want to delete all your friends?
// This can negatively affect your trust rank,
// This action cannot be undone.`,
// 'Delete all friends?',
// {
// confirmButtonText: 'Confirm',
// cancelButtonText: 'Cancel',
// type: 'info',
// callback: (action) => {
// if (action === 'confirm') {
// this.bulkUnfriendAll();
// }
// }
// }
// );
// };
// $app.methods.bulkUnfriendAll = function () {
// for (var ctx of this.friendsListTable.data) {
// API.deleteFriend({
// userId: ctx.id
// });
// }
// };
$app.methods.friendsListSearchChange = function () {
this.friendsListTable.data = [];
var filters = [...this.friendsListSearchFilters];
if (filters.length === 0) {
filters = ['Display Name', 'Rank', 'Status', 'Bio', 'Memo'];
@@ -17679,6 +17759,9 @@ speechSynthesis.getVoices();
if (typeof ctx.ref === 'undefined') {
continue;
}
if (typeof ctx.$selected === 'undefined') {
ctx.$selected = false;
}
if (this.friendsListSearchFilterVIP && !ctx.isVIP) {
continue;
}
@@ -20228,7 +20311,11 @@ speechSynthesis.getVoices();
joinTime: Date.parse(dateTime),
hasInstantiated,
inVRMode: user.inVRMode,
avatarEyeHeight: user.avatarEyeHeight
avatarEyeHeight: user.avatarEyeHeight,
canModerateInstance: user.canModerateInstance,
groupOnNameplate: user.groupOnNameplate,
showGroupBadgeToOthers: user.showGroupBadgeToOthers,
showSocialRank: user.showSocialRank
});
}
}