1
0
mirror of https://github.com/oliverbooth/VpSharp synced 2024-11-25 10:48:47 +00:00

fix: cache avatar only after user is retrieved

This commit is contained in:
Oliver Booth 2024-01-20 17:02:52 +00:00
parent 211d082b7e
commit d9d41e6083
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5
2 changed files with 2 additions and 1 deletions

View File

@ -36,6 +36,7 @@ public sealed partial class VirtualParadiseClient
existing.Location = avatar.Location;
existing.Application = avatar.Application;
existing.Type = avatar.Type;
existing.User = avatar.User;
return existing;
});
}

View File

@ -89,8 +89,8 @@ public sealed partial class VirtualParadiseClient
private async void OnAvatarAddNativeEvent(nint sender)
{
VirtualParadiseAvatar avatar = ExtractAvatar(sender);
avatar = AddOrUpdateAvatar(avatar);
avatar.User = await GetUserAsync(vp_int(sender, IntegerAttribute.UserId)).ConfigureAwait(false);
avatar = AddOrUpdateAvatar(avatar);
_avatarJoined.OnNext(avatar);
}