mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 05:43:51 +02:00
show avatar info (closes #45)
This commit is contained in:
@@ -6043,17 +6043,52 @@ CefSharp.BindObjectAsync(
|
||||
}
|
||||
});
|
||||
} else if (command === 'Show Avatar Author') {
|
||||
var id = extractFileId(D.ref.currentAvatarImageUrl);
|
||||
var { currentAvatarImageUrl } = D.ref;
|
||||
var id = extractFileId(currentAvatarImageUrl);
|
||||
if (id) {
|
||||
API.call(`file/${id}`).then((json) => {
|
||||
if (json.ownerId === D.id) {
|
||||
this.$message({
|
||||
message: 'It\'s personal (own) avatar',
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
this.showUserDialog(json.ownerId);
|
||||
API.call(`file/${id}`).then(({ ownerId }) => {
|
||||
for (var ref of API.cachedAvatars.values()) {
|
||||
if (ref.imageUrl === currentAvatarImageUrl) {
|
||||
this.showAvatarDialog(ref.id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
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 {
|
||||
this.$message({
|
||||
|
||||
Reference in New Issue
Block a user