-
Notifications
You must be signed in to change notification settings - Fork 14
feat: "Report User" feature #7341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sandrade-dcl
wants to merge
49
commits into
dev
Choose a base branch
from
feat/add-report-user-option-in-user-context-menus
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,085
−81
Open
Changes from 37 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
1b81a81
Added "Report" option in all user context menus
sandrade-dcl 6a8edfd
Added confirmation popup when report option is clicked
sandrade-dcl 1510302
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl 70d3e4b
Refactor: Create ReportUserConfirmationDialog for unifying the logic …
sandrade-dcl d84bbca
Update RequestsSectionController.cs
sandrade-dcl 43a113b
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl d680b22
Feature flag implemented
sandrade-dcl 0e3ea75
Update FeaturesRegistry.cs
sandrade-dcl 36a6034
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl d070996
IWebBrowser and IDecentralandUrlsSource dependencies injected
sandrade-dcl 78e04bc
Added ReportUser into DecentralandUrl
sandrade-dcl 8533385
Update ApplicationBlocklistGuard.cs
sandrade-dcl 4a85264
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl 3eed7a4
New GetBanStatus endpoint implemented
sandrade-dcl 191d07f
Added BanStatusData into UserBlockedException
sandrade-dcl ad2111b
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl a1d3240
Update ApplicationBlocklistGuard.cs
sandrade-dcl cf83b21
Added params in the report url
sandrade-dcl 5b343ad
Color for Block and Report options updated
sandrade-dcl 6719641
Implemented ban_warning notification
sandrade-dcl 94a4f5a
Made ban_warning notification doesn't hides automatically
sandrade-dcl 029d828
Made Blocked Screen prefab's info dynamic
sandrade-dcl 078ff0b
Delete DebugNotificationTrigger.cs.meta
sandrade-dcl 11e41ae
Update BlockedScreenController.cs
sandrade-dcl 061ba8d
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl 0f5a028
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl d6a54ad
Update Explorer/Assets/DCL/Communities/CommunitiesBrowser/Communities…
sandrade-dcl eea29fa
Update CommunitiesBrowserController.cs
sandrade-dcl 983cf1c
Implemented banned notification
sandrade-dcl 70881aa
Implemented click on banned notification
sandrade-dcl a5632af
Implemented click on ban_warning notification
sandrade-dcl 2c2ffd3
Added report-user app arg flag
sandrade-dcl fde62ed
Update BlockedScreenController.cs
sandrade-dcl 8652499
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl 4ae7d0d
Small updates in texts
sandrade-dcl ebc8e3e
Update Explorer/Assets/DCL/ApplicationsGuards/ApplicationBlocklistGua…
sandrade-dcl e8e54b6
Update BannedNotificationHandler.cs
sandrade-dcl bff455e
Update BannedNotificationHandler.cs
sandrade-dcl d43548b
Feedback applied
sandrade-dcl c8a1192
Feedback applied
sandrade-dcl 92d4345
Merge branch 'dev' into feat/add-report-user-option-in-user-context-m…
sandrade-dcl b08b819
Updates from figma
sandrade-dcl 7483419
fix: Replace bans url (#7617)
MauroCicerchia 02c7f44
Updates from figma (II)
sandrade-dcl 67c8ccd
Updates from figma (III)
sandrade-dcl d268659
Added new ban_lifted notification
sandrade-dcl 3d78a5c
Apply feedback
sandrade-dcl a5eeb6e
Apply feedback (ReportUserHelper)
sandrade-dcl 0f77192
Apply feedback
sandrade-dcl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...orer/Assets/DCL/ApplicationsGuards/ApplicationBlocklistGuard/BannedNotificationHandler.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| using Cysharp.Threading.Tasks; | ||
| using DCL.Browser; | ||
| using DCL.Diagnostics; | ||
| using DCL.Multiplayer.Connections.DecentralandUrls; | ||
| using DCL.NotificationsBus; | ||
| using DCL.NotificationsBus.NotificationTypes; | ||
| using DCL.Web3.Identities; | ||
| using DCL.WebRequests; | ||
| using MVC; | ||
| using System; | ||
| using System.Threading; | ||
| using Utility; | ||
|
|
||
| namespace DCL.ApplicationBlocklistGuard | ||
| { | ||
| public class BannedNotificationHandler : IDisposable | ||
| { | ||
| private readonly IWebRequestController webRequestController; | ||
| private readonly IDecentralandUrlsSource urlsSource; | ||
| private readonly IWeb3IdentityCache identityCache; | ||
| private readonly ModerationDataProvider moderationDataProvider; | ||
| private readonly IMVCManager mvcManager; | ||
| private readonly IWebBrowser webBrowser; | ||
|
|
||
| private CancellationTokenSource cts = new (); | ||
|
|
||
| public BannedNotificationHandler( | ||
| IWebRequestController webRequestController, | ||
| IDecentralandUrlsSource urlsSource, | ||
| IWeb3IdentityCache identityCache, | ||
| ModerationDataProvider moderationDataProvider, | ||
| IMVCManager mvcManager, | ||
| IWebBrowser webBrowser) | ||
| { | ||
| this.webRequestController = webRequestController; | ||
| this.urlsSource = urlsSource; | ||
| this.identityCache = identityCache; | ||
| this.moderationDataProvider = moderationDataProvider; | ||
| this.mvcManager = mvcManager; | ||
| this.webBrowser = webBrowser; | ||
|
|
||
| NotificationsBusController.Instance.SubscribeToNotificationTypeClick(NotificationType.BAN_WARNING, OnBanWarningNotificationClicked); | ||
| NotificationsBusController.Instance.SubscribeToNotificationTypeClick(NotificationType.BANNED, OnBannedNotificationClicked); | ||
| } | ||
|
|
||
| public void Dispose() => | ||
| cts.SafeCancelAndDispose(); | ||
|
|
||
| private void OnBanWarningNotificationClicked(object[] parameters) => | ||
| webBrowser.OpenUrl(urlsSource.Url(DecentralandUrl.SupportLink)); | ||
|
|
||
| private void OnBannedNotificationClicked(object[] parameters) | ||
| { | ||
| cts = cts.SafeRestart(); | ||
| FetchBanStatusAndShowBlockedScreenAsync(cts.Token).Forget(); | ||
| return; | ||
|
|
||
| async UniTaskVoid FetchBanStatusAndShowBlockedScreenAsync(CancellationToken ct) | ||
sandrade-dcl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| try | ||
| { | ||
| string selfUserId = identityCache.EnsuredIdentity().Address; | ||
|
|
||
| GetBanStatusData banStatusData = await ApplicationBlocklistGuard.IsUserBlocklistedAsync( | ||
| webRequestController, urlsSource, selfUserId, moderationDataProvider, ct); | ||
|
|
||
| if (!banStatusData.isBanned) | ||
| return; | ||
|
|
||
| await mvcManager.ShowAsync(BlockedScreenController.IssueCommand(new BlockedScreenParameters(banStatusData.ban)), ct); | ||
| } | ||
| catch (OperationCanceledException) { } | ||
| catch (Exception e) { ReportHub.LogException(e, ReportCategory.STARTUP); } | ||
| } | ||
| { | ||
| string selfUserId = identityCache.EnsuredIdentity().Address; | ||
|
|
||
| GetBanStatusData banStatusData = await ApplicationBlocklistGuard.IsUserBlocklistedAsync( | ||
| webRequestController, urlsSource, selfUserId, moderationDataProvider, ct); | ||
|
|
||
| if (!banStatusData.isBanned) | ||
| return; | ||
|
|
||
| await mvcManager.ShowAsync(BlockedScreenController.IssueCommand(new BlockedScreenParameters(banStatusData.ban)), ct); | ||
| } | ||
sandrade-dcl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
2 changes: 2 additions & 0 deletions
2
...Assets/DCL/ApplicationsGuards/ApplicationBlocklistGuard/BannedNotificationHandler.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Explorer/Assets/DCL/ApplicationsGuards/ApplicationBlocklistGuard/BlockedScreenParameters.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| namespace DCL.ApplicationBlocklistGuard | ||
| { | ||
| public struct BlockedScreenParameters | ||
| { | ||
| public readonly BannedUserData? BannedUserData; | ||
|
|
||
| public BlockedScreenParameters(BannedUserData? bannedUserData) | ||
| { | ||
| BannedUserData = bannedUserData; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.