About friend and message sending

Hi~ dev team, I meet some questions integrating SDK with my App.
Can I use the friend system in SDK to only send message to my friend but not to a stranger?
For example, user A and B are friends, after A remove B from his friend-list.Can I prevent B from sending A a message? Or there are any callbacks when B send a message to A?

Hi @Alfback!

CometChat does not handle friend management. If you want to associate friends with your users, you must handle friends management in your app. Once two users are friends (i.e. they have accepted each other as friends), then you can associate them as friends in CometChat.

When User A unfriends User B, A can still receive messages sent by B. You will also have to implement a logic to block User B from User A. Refer our documentation for more details.