mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 06:46:04 +02:00
show avatar info (closes #45)
This commit is contained in:
+44
-9
@@ -6043,17 +6043,52 @@ CefSharp.BindObjectAsync(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (command === 'Show Avatar Author') {
|
} else if (command === 'Show Avatar Author') {
|
||||||
var id = extractFileId(D.ref.currentAvatarImageUrl);
|
var { currentAvatarImageUrl } = D.ref;
|
||||||
|
var id = extractFileId(currentAvatarImageUrl);
|
||||||
if (id) {
|
if (id) {
|
||||||
API.call(`file/${id}`).then((json) => {
|
API.call(`file/${id}`).then(({ ownerId }) => {
|
||||||
if (json.ownerId === D.id) {
|
for (var ref of API.cachedAvatars.values()) {
|
||||||
this.$message({
|
if (ref.imageUrl === currentAvatarImageUrl) {
|
||||||
message: 'It\'s personal (own) avatar',
|
this.showAvatarDialog(ref.id);
|
||||||
type: 'warning'
|
return;
|
||||||
});
|
}
|
||||||
} else {
|
|
||||||
this.showUserDialog(json.ownerId);
|
|
||||||
}
|
}
|
||||||
|
D.loading = true;
|
||||||
|
var params = {
|
||||||
|
n: 100,
|
||||||
|
offset: 0,
|
||||||
|
sort: 'updated',
|
||||||
|
order: 'descending',
|
||||||
|
user: 'friends',
|
||||||
|
userId: ownerId,
|
||||||
|
releaseStatus: 'public'
|
||||||
|
};
|
||||||
|
if (params.userId === API.currentUser.id) {
|
||||||
|
params.user = 'me';
|
||||||
|
params.releaseStatus = 'all';
|
||||||
|
}
|
||||||
|
API.bulk({
|
||||||
|
fn: 'getAvatars',
|
||||||
|
N: -1,
|
||||||
|
params,
|
||||||
|
done: () => {
|
||||||
|
D.loading = false;
|
||||||
|
for (var ref2 of API.cachedAvatars.values()) {
|
||||||
|
if (ref2.imageUrl === currentAvatarImageUrl) {
|
||||||
|
this.showAvatarDialog(ref2.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ownerId === D.id) {
|
||||||
|
this.$message({
|
||||||
|
message: 'It\'s personal (own) avatar',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.showUserDialog(ownerId);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
Reference in New Issue
Block a user