From e7d8ce073e5a4055dcfbb25454150251e9e89d53 Mon Sep 17 00:00:00 2001 From: Nicolas Lorusso Date: Thu, 21 Sep 2023 15:53:25 -0300 Subject: [PATCH 1/2] propagation of block status through comms --- browser-interface/packages/shared/comms/sagas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser-interface/packages/shared/comms/sagas.ts b/browser-interface/packages/shared/comms/sagas.ts index 5f8e7abe4c..c90174f708 100644 --- a/browser-interface/packages/shared/comms/sagas.ts +++ b/browser-interface/packages/shared/comms/sagas.ts @@ -410,7 +410,7 @@ async function stripSnapshots(profile: Avatar): Promise { ...profile, avatar: { ...profile.avatar, snapshots: newSnapshots as Snapshots }, // THIS IS IMPORTANT, the blocked and muted sizes are too big for the network and are unnecesary - blocked: [], + // blocked: [], muted: [] } } From 758c31c6ad031e32d6c2eafabdec019512803c21 Mon Sep 17 00:00:00 2001 From: Nicolas Lorusso Date: Thu, 21 Sep 2023 17:21:05 -0300 Subject: [PATCH 2/2] fixed blocked by peer status on the user context menu and in the passport --- .../packages/shared/comms/sagas.ts | 2 + .../PassportPlayerInfoComponentController.cs | 2 +- .../PassportPlayerInfoComponentView.cs | 14 +- .../Passport/Passport/PlayerPassportModel.cs | 2 +- .../UserContextMenuPanel.prefab | 588 +++++++++++++++--- .../Scripts/UserContextMenu.cs | 26 +- 6 files changed, 542 insertions(+), 92 deletions(-) diff --git a/browser-interface/packages/shared/comms/sagas.ts b/browser-interface/packages/shared/comms/sagas.ts index c90174f708..cae83b027f 100644 --- a/browser-interface/packages/shared/comms/sagas.ts +++ b/browser-interface/packages/shared/comms/sagas.ts @@ -410,6 +410,8 @@ async function stripSnapshots(profile: Avatar): Promise { ...profile, avatar: { ...profile.avatar, snapshots: newSnapshots as Snapshots }, // THIS IS IMPORTANT, the blocked and muted sizes are too big for the network and are unnecesary + // blocked status propagation has been re-enabled so the current user knows when a peer has blocked it + // use case: you shouldn't be able to send messages or friend requests to peers that blocked you // blocked: [], muted: [] } diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentController.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentController.cs index 682f25d8df..4ef283f39a 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentController.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentController.cs @@ -124,7 +124,7 @@ private async UniTask UpdateWithUserProfileAsync(UserProfile userProfile, Cancel presenceStatus = friendsController.GetUserStatus(userProfile.userId).presence, isGuest = userProfile.isGuest, isBlocked = ownUserProfile.IsBlocked(userProfile.userId), - hasBlocked = userProfile.IsBlocked(ownUserProfile.userId), + isBlockedByPeer = userProfile.IsBlocked(ownUserProfile.userId), friendshipStatus = await friendsController.GetFriendshipStatus(userProfile.userId, cancellationToken), isFriendshipVisible = isFriendsEnabled && friendsController.IsInitialized, }; diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentView.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentView.cs index e9e75c55e5..6e3116ac58 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentView.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerInfo/PassportPlayerInfoComponentView.cs @@ -63,7 +63,6 @@ public class PassportPlayerInfoComponentView : BaseComponentView friendStatusButtonsMapping; private CancellationTokenSource cts; @@ -115,7 +114,7 @@ public override void RefreshControl() SetWallet(model.userId); SetPresence(model.presenceStatus); SetIsBlocked(model.isBlocked); - SetHasBlockedOwnUser(model.hasBlocked); + SetIsBlockedByPeer(model.isBlockedByPeer); SetFriendStatus(model.friendshipStatus); SetFriendshipVisibility(model.isFriendshipVisible); } @@ -151,7 +150,7 @@ public void SetFriendStatus(FriendshipStatus friendStatus) { areFriends = friendStatus == FriendshipStatus.FRIEND; - if (isBlocked) + if (model.isBlocked || model.isBlockedByPeer) return; DisableAllFriendFlowButtons(); @@ -191,14 +190,16 @@ private void SetWallet(string wallet) public void SetIsBlocked(bool isBlocked) { - this.isBlocked = isBlocked; + model.isBlocked = isBlocked; + DisableAllFriendFlowButtons(); blockedFriendButton.gameObject.SetActive(isBlocked); optionsContainer.SetActive(!isBlocked); blockedLabel.SetActive(isBlocked); - if (!isBlocked) { SetFriendStatus(model.friendshipStatus); } + if (!isBlocked && !model.isBlockedByPeer) + SetFriendStatus(model.friendshipStatus); } public void SetActionsActive(bool isActive) => @@ -223,9 +224,10 @@ private void SetGuestUser(bool isGuest) normalUserPanel.SetActive(!isGuest); } - private void SetHasBlockedOwnUser(bool hasBlocked) + private void SetIsBlockedByPeer(bool hasBlocked) { friendsFlowContainer.SetActive(!hasBlocked); + DisableAllFriendFlowButtons(); } private void DisableAllFriendFlowButtons() diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerPassportModel.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerPassportModel.cs index 8dd9724a34..6892d31d58 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerPassportModel.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/Passport/Passport/PlayerPassportModel.cs @@ -9,7 +9,7 @@ public record PlayerPassportModel public PresenceStatus presenceStatus; public bool isGuest; public bool isBlocked; - public bool hasBlocked; + public bool isBlockedByPeer; public FriendshipStatus friendshipStatus; public bool isFriendshipVisible; } diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/SocialBarPrefabs/UserContextMenu/UserContextMenuPanel.prefab b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/SocialBarPrefabs/UserContextMenu/UserContextMenuPanel.prefab index b6c5c8c64b..0b6d1cfdb0 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/SocialBarPrefabs/UserContextMenu/UserContextMenuPanel.prefab +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/SocialBarPrefabs/UserContextMenu/UserContextMenuPanel.prefab @@ -36,7 +36,6 @@ RectTransform: - {fileID: 8740894294886845968} - {fileID: 3212861919107043162} m_Father: {fileID: 1697453541807700629} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -199,7 +198,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6314613212027488367} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -295,7 +293,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 9109606891818156669} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -432,7 +429,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7833117278873804047} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -529,12 +525,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 874867509963922894} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 18} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 39.945, y: -18} + m_SizeDelta: {x: 18, y: 18} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6256284673879661972 CanvasRenderer: @@ -630,11 +625,10 @@ RectTransform: - {fileID: 7281233178021369920} - {fileID: 8566324444237578834} m_Father: {fileID: 4402643883142646717} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 78, y: -54} m_SizeDelta: {x: 156, y: 36} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5074212577009176970 @@ -793,13 +787,13 @@ RectTransform: - {fileID: 874867509963922894} - {fileID: 4059770962480349046} - {fileID: 6925772469794557582} + - {fileID: 2418158818043769592} m_Father: {fileID: 6208790594406829408} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 98, y: -189.95} + m_SizeDelta: {x: 156, y: 144} m_Pivot: {x: 0.5, y: 0} --- !u!114 &1611626389276883358 MonoBehaviour: @@ -858,7 +852,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1559391499053547033} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -995,7 +988,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 9109606891818156669} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1097,11 +1089,10 @@ RectTransform: - {fileID: 1459499957946005035} - {fileID: 7321099810265048245} m_Father: {fileID: 1697453541807700629} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 96, y: -170} + m_AnchoredPosition: {x: 96, y: -62} m_SizeDelta: {x: 156, y: 36} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1774775137059238665 @@ -1248,6 +1239,246 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!1 &1769450958989240615 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7774501392090599845} + - component: {fileID: 6908866217455681010} + - component: {fileID: 1986376255423313472} + - component: {fileID: 4627489684384389953} + m_Layer: 20 + m_Name: Blocked + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7774501392090599845 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1769450958989240615} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 321345746861095837} + - {fileID: 1009479389115469213} + - {fileID: 6491671640939375079} + m_Father: {fileID: 2418158818043769592} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6908866217455681010 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1769450958989240615} + m_CullTransparentMesh: 0 +--- !u!114 &1986376255423313472 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1769450958989240615} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: f02af068e11cb4902a1a4faad10b890a, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 3 +--- !u!114 &4627489684384389953 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1769450958989240615} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 4 + m_Spacing: 6 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!1 &2125006930326104182 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6491671640939375079} + - component: {fileID: 9039783468721685483} + - component: {fileID: 7027902206199854613} + m_Layer: 20 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6491671640939375079 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2125006930326104182} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7774501392090599845} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 90, y: -18} + m_SizeDelta: {x: 57.02, y: 21} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &9039783468721685483 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2125006930326104182} + m_CullTransparentMesh: 0 +--- !u!114 &7027902206199854613 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2125006930326104182} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Blocked + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: a02669827dd9144f39b4b164e753a21a, type: 2} + m_sharedMaterial: {fileID: 2100000, guid: 74b83fa9a54124695b9bdd8bea96fa17, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 12 + m_fontSizeBase: 11 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 10 + m_fontSizeMax: 12 + m_fontStyle: 16 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 1 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &2222092931775629717 GameObject: m_ObjectHideFlags: 0 @@ -1279,12 +1510,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4059770962480349046} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 21} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 89, y: -18} + m_SizeDelta: {x: 108.76, y: 21} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3769573704859396206 CanvasRenderer: @@ -1415,7 +1645,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4678502028939231263} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -1553,7 +1782,6 @@ RectTransform: - {fileID: 8489894846506230600} - {fileID: 4402643883142646717} m_Father: {fileID: 209470434955866080} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1594,6 +1822,102 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2509732966232078900} m_CullTransparentMesh: 0 +--- !u!1 &2608674253480282457 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 321345746861095837} + - component: {fileID: 2976499011232796389} + - component: {fileID: 4016072668048495017} + - component: {fileID: 2237692934169913084} + m_Layer: 20 + m_Name: Outline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &321345746861095837 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608674253480282457} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7774501392090599845} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2976499011232796389 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608674253480282457} + m_CullTransparentMesh: 1 +--- !u!114 &4016072668048495017 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608674253480282457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2627451, g: 0.2509804, b: 0.2901961, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 4848194f7bc4d4e509d067d3160eadac, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 3 +--- !u!114 &2237692934169913084 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2608674253480282457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 1 + m_MinWidth: -1 + m_MinHeight: -1 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &2765004884216864864 GameObject: m_ObjectHideFlags: 0 @@ -1626,7 +1950,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3815080001497336462} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1727,7 +2050,6 @@ RectTransform: - {fileID: 6314613212027488367} - {fileID: 4678502028939231263} m_Father: {fileID: 209470434955866080} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1797,7 +2119,6 @@ RectTransform: - {fileID: 5230658050007599708} - {fileID: 1697453541807700629} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -1816,6 +2137,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3ca92589a6cb2ca4d84cbafdcced1755, type: 3} m_Name: m_EditorClassIdentifier: + showHideAnimator: {fileID: 0} + hideWhenClickedOutsideArea: 1 confirmationDialog: {fileID: 0} menuConfigFlags: -1 enableSendMessage: 1 @@ -1824,6 +2147,7 @@ MonoBehaviour: friendAddContainer: {fileID: 8987714422498632940} friendRemoveContainer: {fileID: 7036840294256032757} friendRequestedContainer: {fileID: 761280394401511834} + blockedContainer: {fileID: 4158452794925138864} userName: {fileID: 4059980229021049056} blockText: {fileID: 2583684662727995992} passportButton: {fileID: 2231115598086967799} @@ -1949,7 +2273,6 @@ RectTransform: - {fileID: 8279228984979663838} - {fileID: 2541361005738491005} m_Father: {fileID: 6925772469794557582} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -2020,6 +2343,42 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 +--- !u!1 &4158452794925138864 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2418158818043769592} + m_Layer: 20 + m_Name: Blocked + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2418158818043769592 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4158452794925138864} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7774501392090599845} + m_Father: {fileID: 4402643883142646717} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 78, y: -126} + m_SizeDelta: {x: 156, y: 36} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &4517969522744211585 GameObject: m_ObjectHideFlags: 0 @@ -2053,7 +2412,6 @@ RectTransform: m_Children: - {fileID: 3523302219020209382} m_Father: {fileID: 6208790594406829408} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2217,7 +2575,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 209470434955866080} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2332,7 +2689,6 @@ RectTransform: - {fileID: 7938831965341739030} - {fileID: 7186371973213425299} m_Father: {fileID: 1697453541807700629} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2463,6 +2819,102 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 +--- !u!1 &4750183163768174886 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1009479389115469213} + - component: {fileID: 5607189537997280760} + - component: {fileID: 2712061500245126684} + - component: {fileID: 8317679600671845511} + m_Layer: 20 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1009479389115469213 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4750183163768174886} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7774501392090599845} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 46.489998, y: -18} + m_SizeDelta: {x: 18, y: 18} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5607189537997280760 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4750183163768174886} + m_CullTransparentMesh: 1 +--- !u!114 &2712061500245126684 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4750183163768174886} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 518e3be6157b64d5a9fabd3e9c35622d, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &8317679600671845511 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4750183163768174886} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 18 + m_MinHeight: 18 + m_PreferredWidth: 18 + m_PreferredHeight: 18 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &4998034079656445918 GameObject: m_ObjectHideFlags: 0 @@ -2495,12 +2947,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4059770962480349046} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 18} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 21.619995, y: -18} + m_SizeDelta: {x: 18, y: 18} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5697590735785824349 CanvasRenderer: @@ -2592,7 +3043,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4678502028939231263} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -2688,7 +3138,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6314613212027488367} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -2824,12 +3273,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7833117278873804047} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 21} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 90, y: -18} + m_SizeDelta: {x: 50.85, y: 21} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &52717574898514223 CanvasRenderer: @@ -2960,7 +3408,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3815080001497336462} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3097,7 +3544,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5191761706286609472} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3192,11 +3638,10 @@ RectTransform: m_Children: - {fileID: 7833117278873804047} m_Father: {fileID: 4402643883142646717} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 78, y: -90} m_SizeDelta: {x: 156, y: 36} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7383115572565308787 @@ -3230,7 +3675,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5191761706286609472} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3370,7 +3814,6 @@ RectTransform: m_Children: - {fileID: 7729952426779212640} m_Father: {fileID: 8489894846506230600} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -3526,12 +3969,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 874867509963922894} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 21} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 89, y: -18} + m_SizeDelta: {x: 72.11, y: 21} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8366447033655507365 CanvasRenderer: @@ -3663,12 +4105,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7833117278873804047} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 18} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 49.575, y: -18} + m_SizeDelta: {x: 18, y: 18} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3868292219736588339 CanvasRenderer: @@ -3765,7 +4206,6 @@ RectTransform: - {fileID: 6506555174203901896} - {fileID: 2414586391627009806} m_Father: {fileID: 1697453541807700629} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -3952,7 +4392,6 @@ RectTransform: - {fileID: 7685703826391962030} - {fileID: 7121501207148520764} m_Father: {fileID: 1697453541807700629} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4119,7 +4558,6 @@ RectTransform: - {fileID: 6644512341496027995} - {fileID: 2613626442612894089} m_Father: {fileID: 1697453541807700629} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4282,7 +4720,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1559391499053547033} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4383,11 +4820,10 @@ RectTransform: - {fileID: 1284093012086399165} - {fileID: 5221375019933869631} m_Father: {fileID: 4402643883142646717} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 78, y: -18} m_SizeDelta: {x: 156, y: 36} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6794649913784874489 @@ -4519,6 +4955,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 3523302219020209382} m_Modifications: - target: {fileID: 910873934197864832, guid: 69d18becfc9ef4b7f92abaeae62a2ece, @@ -4674,6 +5111,9 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 69d18becfc9ef4b7f92abaeae62a2ece, type: 3} --- !u!114 &6177229564709651564 stripped MonoBehaviour: diff --git a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/UserContextMenu/Scripts/UserContextMenu.cs b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/UserContextMenu/Scripts/UserContextMenu.cs index 6524222a9d..3448b28884 100644 --- a/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/UserContextMenu/Scripts/UserContextMenu.cs +++ b/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/UserContextMenu/Scripts/UserContextMenu.cs @@ -55,6 +55,7 @@ public enum MenuConfigFlags [SerializeField] internal GameObject friendAddContainer; [SerializeField] internal GameObject friendRemoveContainer; [SerializeField] internal GameObject friendRequestedContainer; + [SerializeField] internal GameObject blockedContainer; [Header("Texts")] [SerializeField] internal TextMeshProUGUI userName; @@ -89,6 +90,7 @@ public enum MenuConfigFlags private static BaseVariable<(string playerId, string source)> currentPlayerId; private string userId; private bool isBlocked; + private bool isBlockedByPeer; private MenuConfigFlags currentConfigFlags; private IConfirmationDialog currentConfirmationDialog; private CancellationTokenSource friendOperationsCancellationToken = new (); @@ -346,7 +348,7 @@ private void ProcessActiveElements(MenuConfigFlags flags) passportButton.gameObject.SetActive((flags & MenuConfigFlags.Passport) != 0); blockButton.gameObject.SetActive((flags & MenuConfigFlags.Block) != 0 && !isOwnUser); reportButton.gameObject.SetActive((flags & MenuConfigFlags.Report) != 0 && !isOwnUser); - messageButton.gameObject.SetActive((flags & MenuConfigFlags.Message) != 0 && !isBlocked && enableSendMessage && !isOwnUser); + messageButton.gameObject.SetActive((flags & MenuConfigFlags.Message) != 0 && !isBlocked && !isBlockedByPeer && enableSendMessage && !isOwnUser); if (mentionButton != null) mentionButton.gameObject.SetActive((flags & MenuConfigFlags.Mention) != 0 && DataStore.i.HUDs.chatInputVisible.Get()); @@ -364,7 +366,9 @@ private bool Setup(string userId, MenuConfigFlags configFlags) return false; } - if (profile.isGuest || !UserProfile.GetOwnUserProfile().hasConnectedWeb3) + var ownUserProfile = UserProfile.GetOwnUserProfile(); + + if (profile.isGuest || !ownUserProfile.hasConnectedWeb3) configFlags &= ~USES_FRIENDS_API_FLAGS; currentConfigFlags = configFlags; @@ -372,15 +376,13 @@ private bool Setup(string userId, MenuConfigFlags configFlags) if ((configFlags & MenuConfigFlags.Block) != 0) { - isBlocked = UserProfile.GetOwnUserProfile().blocked.Contains(userId); + isBlocked = ownUserProfile.IsBlocked(userId); + isBlockedByPeer = profile.IsBlocked(ownUserProfile.userId); blockText.text = isBlocked ? BLOCK_BTN_UNBLOCK_TEXT : BLOCK_BTN_BLOCK_TEXT; } if ((configFlags & MenuConfigFlags.Name) != 0) - { - string name = profile?.userName; - userName.text = name; - } + userName.text = profile.userName; if ((configFlags & USES_FRIENDS_API_FLAGS) != 0) { @@ -405,10 +407,11 @@ private void SetupFriendship(FriendshipStatus friendshipStatus) friendAddContainer.SetActive(false); friendRemoveContainer.SetActive(true); friendRequestedContainer.SetActive(false); + blockedContainer.SetActive(false); deleteFriendButton.gameObject.SetActive(true); } - if (messageEnabled) { messageButton.gameObject.SetActive(!isBlocked && enableSendMessage); } + if (messageEnabled) { messageButton.gameObject.SetActive(!isBlocked & !isBlockedByPeer && enableSendMessage); } } else if (friendshipStatus == FriendshipStatus.REQUESTED_TO) { @@ -417,6 +420,7 @@ private void SetupFriendship(FriendshipStatus friendshipStatus) friendAddContainer.SetActive(false); friendRemoveContainer.SetActive(false); friendRequestedContainer.SetActive(true); + blockedContainer.SetActive(false); deleteFriendButton.gameObject.SetActive(false); } @@ -426,9 +430,10 @@ private void SetupFriendship(FriendshipStatus friendshipStatus) { if (friendshipEnabled) { - friendAddContainer.SetActive(true); + friendAddContainer.SetActive(!isBlocked & !isBlockedByPeer); friendRemoveContainer.SetActive(false); friendRequestedContainer.SetActive(false); + blockedContainer.SetActive(isBlocked | isBlockedByPeer); deleteFriendButton.gameObject.SetActive(false); } @@ -438,9 +443,10 @@ private void SetupFriendship(FriendshipStatus friendshipStatus) { if (friendshipEnabled) { - friendAddContainer.SetActive(true); + friendAddContainer.SetActive(!isBlocked & !isBlockedByPeer); friendRemoveContainer.SetActive(false); friendRequestedContainer.SetActive(false); + blockedContainer.SetActive(isBlocked | isBlockedByPeer); deleteFriendButton.gameObject.SetActive(false); }