Trustroots / trustroots

Travellers' community for sharing, hosting and getting people together.
https://www.trustroots.org
GNU Affero General Public License v3.0
398 stars 137 forks source link

A mechanism for users to block abusive users #1467

Closed simison closed 9 months ago

simison commented 4 years ago

Is your feature request related to a problem? Please describe. Users would need to be able to block each other right away, without writing to and waiting for support to remove offending users.

Describe the solution you'd like Add "block member" link in users' profiles:

Clicking the button can open regular JS window.confirm() question, doesn't need anything fancier:

(with different text ;-) )

Confirming this, it will add blocked user's ID in authenticated user's profile.

When A wants to block B, A will end up with profile data looking like:

user: A,
blocked: [ B ]

This should work similar to shadowban role (see code, or issue https://github.com/Trustroots/trustroots/issues/1184) in a way that blocker user just gets hidden for the other user quietly.

Describe alternatives you've considered

Additional context

This will help us comply with Apple's app review requirement: https://github.com/Trustroots/trustroots-expo-mobile/issues/10#issuecomment-631104166 ...and it's a nice safety feature regardless.

gabrielsr commented 4 years ago

Working on an api for it. (PR #1490)

loberto commented 4 years ago

could this be a simple check box in the report dialog box?

simison commented 4 years ago

Good idea!

There's still value in having two separate links in the profile, but the "block member" could bring to "report member" support form with "[x] block reported member from seeing me" pre-checked.

When regularly reporting member, the check could be unchecked.

simison commented 4 years ago

That said, if it's easier for someone to implement the "click + confirm" thing, that's fine too. Just to get the ball rolling and we can then iterate.

simison commented 3 years ago

Client-side implementation:

Copy this component in the same file:

https://github.com/Trustroots/trustroots/blob/56adf8076a77ed1d91a88d3406196300bc99a48a/modules/users/client/views/profile/profile-view-basics.client.view.html#L6-L9

Here's the component to duplicate:

https://github.com/Trustroots/trustroots/blob/56adf8076a77ed1d91a88d3406196300bc99a48a/modules/support/client/components/ReportMemberLink.component.js

Here's an example of API file you'll need:

https://github.com/Trustroots/trustroots/blob/56adf8076a77ed1d91a88d3406196300bc99a48a/modules/tribes/client/api/tribes.api.js#L1-L6

And here's an example of how to use API function:

https://github.com/Trustroots/trustroots/blob/2c9d436140383a1420aabe8c4a81292f1352c9e3/modules/tribes/client/components/JoinButton.js#L81-L95

And maybe as a result, you can just show a success message with window.alert('Some message') and/or just redirect to the homepage after success?

Here's what the backend API expects:

https://github.com/Trustroots/trustroots/blob/baad4238000cae44479e018c57e110dab60de498/modules/users/server/controllers/users.block.server.controller.js#L34-L75

So looks like something like profile: { _id: USER_ID_HERE }

...in route /api/blocked-users/USERNAME:

https://github.com/Trustroots/trustroots/blob/baad4238000cae44479e018c57e110dab60de498/modules/users/server/routes/users-block.server.routes.js#L14-L19

annazi-maker commented 3 years ago

I just want to say that i second and support this feature. In couchsurfing I blocked users but they still commented and harassed my events. Blocking must be ''catholic' if i can use this term. When I block someone in TR he/she cannot see what im writing in other parts of the app. Is that technically easy? I dont know. I am just sharing my bad experience with the blocking function in couchsurfing app. Blocked users still could chat me and harass me in the hang-out chat function of the CS app and leave trolling comments on every single event I created. So blocking him in couchsurfing amounted next to nothing in terms of giving me some peace from haters/trolls.

simison commented 3 years ago

@annazi-maker we at Trustroots have zero tolerance for harassment so in cases where they'd be able to interact in public spaces, our support would suspend them for such behavior.

Thanks for sharing your thoughts!

MrSalami commented 3 years ago

Are we almost finished with these tasks? Who can finish this off so we can re submit for review? @gabrielsr Do you have any time? I know that @simison has been busy with other projects..

simison commented 3 years ago

I think important parts that Apple requested are now in. Would be good to add FAQ entry and the rest are "nice to have" follow-ups.

chagai95 commented 2 years ago

Where is this stuck on? @simison Could we help diploy this in any way?