Skip to content
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

Block Option #10

Open
Shruti2208 opened this issue Jul 14, 2020 · 1 comment
Open

Block Option #10

Shruti2208 opened this issue Jul 14, 2020 · 1 comment

Comments

@Shruti2208
Copy link

How can we implement block feature in iOS app?
Please assist.

@sponzillo
Copy link
Contributor

Hi Shruti,

you should modify this function:

https://github.com/chat21/chat21-cloud-functions/blob/9173f3261678963fff54d9bfcde68a1e332f90c5/functions/chat-api.js#L957

The right way is to create a "blocked users database" (out of chat21, using for example mongodb or some other RDMS) of users blocked by users (User A blocked: B, C, D).

In the function, on the very first line check your "blocked users database" to see if sender_id can write to recipient_id. If yes just execute the normal function's instructions flow, otherwise simply "return", without executing any code.

Andrea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants