From d9d41e6083171b86db33fea56c07ce540ef4c1e5 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sat, 20 Jan 2024 17:02:52 +0000 Subject: [PATCH] fix: cache avatar only after user is retrieved --- VpSharp/src/VirtualParadiseClient.Avatars.cs | 1 + VpSharp/src/VirtualParadiseClient.NativeEvents.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/VpSharp/src/VirtualParadiseClient.Avatars.cs b/VpSharp/src/VirtualParadiseClient.Avatars.cs index 8853347..d5c3fdd 100644 --- a/VpSharp/src/VirtualParadiseClient.Avatars.cs +++ b/VpSharp/src/VirtualParadiseClient.Avatars.cs @@ -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; }); } diff --git a/VpSharp/src/VirtualParadiseClient.NativeEvents.cs b/VpSharp/src/VirtualParadiseClient.NativeEvents.cs index a429aba..f76f624 100644 --- a/VpSharp/src/VirtualParadiseClient.NativeEvents.cs +++ b/VpSharp/src/VirtualParadiseClient.NativeEvents.cs @@ -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); }