mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Show hidden friend requests
This commit is contained in:
@@ -1675,7 +1675,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
option
|
||||||
};
|
};
|
||||||
this.$emit('WORLD:LIST', args);
|
this.$emit('WORLD:LIST', args);
|
||||||
return args;
|
return args;
|
||||||
@@ -1916,6 +1917,21 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.deleteHiddenFriendRequest = function (params, userId) {
|
||||||
|
return this.call(`user/${userId}/friendRequest`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params,
|
||||||
|
userId
|
||||||
|
};
|
||||||
|
this.$emit('NOTIFICATION:HIDE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
params: {
|
params: {
|
||||||
userId: string
|
userId: string
|
||||||
@@ -2158,6 +2174,18 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
API.$on('NOTIFICATION:LIST:HIDDEN', function (args) {
|
||||||
|
for (var json of args.json) {
|
||||||
|
json.type = 'hiddenFriendRequest';
|
||||||
|
this.$emit('NOTIFICATION', {
|
||||||
|
json,
|
||||||
|
params: {
|
||||||
|
notificationId: json.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
API.$on('NOTIFICATION:ACCEPT', function (args) {
|
API.$on('NOTIFICATION:ACCEPT', function (args) {
|
||||||
var ref = this.cachedNotifications.get(args.params.notificationId);
|
var ref = this.cachedNotifications.get(args.params.notificationId);
|
||||||
if (typeof ref === 'undefined' ||
|
if (typeof ref === 'undefined' ||
|
||||||
@@ -2237,6 +2265,9 @@ speechSynthesis.getVoices();
|
|||||||
API.expireNotifications = function () {
|
API.expireNotifications = function () {
|
||||||
for (var ref of this.cachedNotifications.values()) {
|
for (var ref of this.cachedNotifications.values()) {
|
||||||
ref.$isExpired = true;
|
ref.$isExpired = true;
|
||||||
|
if ((ref.type === 'friendRequest') || (ref.type === 'hiddenFriendRequest')) {
|
||||||
|
this.cachedNotifications.delete(ref.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2272,6 +2303,19 @@ speechSynthesis.getVoices();
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var params = {
|
||||||
|
n: 100,
|
||||||
|
offset: 0
|
||||||
|
};
|
||||||
|
var count = 50; //5000 max
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
var args = await this.getHiddenFriendRequests(params);
|
||||||
|
$app.unseenNotifications = [];
|
||||||
|
params.offset += 100;
|
||||||
|
if (args.json.length < 100) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.deleteExpiredNotifcations();
|
this.deleteExpiredNotifcations();
|
||||||
this.isNotificationsLoading = false;
|
this.isNotificationsLoading = false;
|
||||||
};
|
};
|
||||||
@@ -2299,6 +2343,24 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.getHiddenFriendRequests = function (params) {
|
||||||
|
return this.call('auth/user/notifications', {
|
||||||
|
method: 'GET',
|
||||||
|
params: {
|
||||||
|
type: 'friendRequest',
|
||||||
|
hidden: true,
|
||||||
|
...params
|
||||||
|
}
|
||||||
|
}).then((json) => {
|
||||||
|
var args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
this.$emit('NOTIFICATION:LIST:HIDDEN', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
API.clearNotifications = function () {
|
API.clearNotifications = function () {
|
||||||
return this.call('auth/user/notifications/clear', {
|
return this.call('auth/user/notifications/clear', {
|
||||||
method: 'PUT'
|
method: 'PUT'
|
||||||
@@ -2329,7 +2391,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
receiverUserId
|
||||||
};
|
};
|
||||||
this.$emit('NOTIFICATION:INVITE:SEND', args);
|
this.$emit('NOTIFICATION:INVITE:SEND', args);
|
||||||
return args;
|
return args;
|
||||||
@@ -2344,7 +2407,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
receiverUserId
|
||||||
};
|
};
|
||||||
this.$emit('NOTIFICATION:INVITE:PHOTO:SEND', args);
|
this.$emit('NOTIFICATION:INVITE:PHOTO:SEND', args);
|
||||||
return args;
|
return args;
|
||||||
@@ -2358,7 +2422,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
receiverUserId
|
||||||
};
|
};
|
||||||
this.$emit('NOTIFICATION:REQUESTINVITE:SEND', args);
|
this.$emit('NOTIFICATION:REQUESTINVITE:SEND', args);
|
||||||
return args;
|
return args;
|
||||||
@@ -2373,7 +2438,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
receiverUserId
|
||||||
};
|
};
|
||||||
this.$emit('NOTIFICATION:REQUESTINVITE:PHOTO:SEND', args);
|
this.$emit('NOTIFICATION:REQUESTINVITE:PHOTO:SEND', args);
|
||||||
return args;
|
return args;
|
||||||
@@ -7558,9 +7624,17 @@ speechSynthesis.getVoices();
|
|||||||
type: 'info',
|
type: 'info',
|
||||||
callback: (action) => {
|
callback: (action) => {
|
||||||
if (action === 'confirm') {
|
if (action === 'confirm') {
|
||||||
API.hideNotification({
|
if (row.type === 'hiddenFriendRequest') {
|
||||||
notificationId: row.id
|
API.deleteHiddenFriendRequest({
|
||||||
});
|
notificationId: row.id
|
||||||
|
},
|
||||||
|
row.senderUserId
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
API.hideNotification({
|
||||||
|
notificationId: row.id
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -11512,7 +11586,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
fileId
|
||||||
};
|
};
|
||||||
this.$emit('AVATARIMAGE:INIT', args);
|
this.$emit('AVATARIMAGE:INIT', args);
|
||||||
return args;
|
return args;
|
||||||
@@ -11816,7 +11891,8 @@ speechSynthesis.getVoices();
|
|||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
var args = {
|
var args = {
|
||||||
json,
|
json,
|
||||||
params
|
params,
|
||||||
|
fileId
|
||||||
};
|
};
|
||||||
this.$emit('WORLDIMAGE:INIT', args);
|
this.$emit('WORLDIMAGE:INIT', args);
|
||||||
return args;
|
return args;
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ html
|
|||||||
template(#tool)
|
template(#tool)
|
||||||
div(style="margin:0 0 10px;display:flex;align-items:center")
|
div(style="margin:0 0 10px;display:flex;align-items:center")
|
||||||
el-select(v-model="notificationTable.filters[0].value" multiple clearable collapse-tags style="flex:1" placeholder="Filter")
|
el-select(v-model="notificationTable.filters[0].value" multiple clearable collapse-tags style="flex:1" placeholder="Filter")
|
||||||
el-option(v-once v-for="type in ['requestInvite', 'invite', 'requestInviteResponse', 'inviteResponse', 'friendRequest', 'message']" :key="type" :label="type" :value="type")
|
el-option(v-once v-for="type in ['requestInvite', 'invite', 'requestInviteResponse', 'inviteResponse', 'friendRequest', 'hiddenFriendRequest', 'message']" :key="type" :label="type" :value="type")
|
||||||
el-input(v-model="notificationTable.filters[1].value" placeholder="Search" style="flex:none;width:150px;margin:0 10px")
|
el-input(v-model="notificationTable.filters[1].value" placeholder="Search" style="flex:none;width:150px;margin:0 10px")
|
||||||
el-tooltip(placement="bottom" content="Refresh" :disabled="hideTooltips")
|
el-tooltip(placement="bottom" content="Refresh" :disabled="hideTooltips")
|
||||||
el-button(type="default" :loading="API.isNotificationsLoading" @click="API.refreshNotifications()" icon="el-icon-refresh" circle style="flex:none")
|
el-button(type="default" :loading="API.isNotificationsLoading" @click="API.refreshNotifications()" icon="el-icon-refresh" circle style="flex:none")
|
||||||
|
|||||||
Reference in New Issue
Block a user