Friends Synchronization

Modified on Fri, 28 Oct 2022 at 02:46 PM

By default, all users who login to your website will be present in the contact list and will be able to chat with each other. 

But you may want that only certain users who have some relationship established can chat with each other and not all. 

For example, on a social site, only a user who is my friend or a connection or a match should be able to chat with me. 

Or for example, in a consultation marketplace, I should only be able to chat with the consultant I have selected or been assigned. 

The connection could be any. And the aim is to allow only connected users to chat. 

Does AtomChat create these connections for you?

No, your website has to have the functionality for your users to create connections. For example, adding and accepting users as friends. AtomChat will only require the unique identifier that differentiates two users as 'Friends'.

ENABLE FRIENDS FEATURE
Go to your AtomChat Admin Panel-> Settings-> Contacts Configuration 
Standard Contacts Configuration-> In Contacts tab, show:-> select the Friends option
<!-- USER MANAGEMENT CODE -->

<!-- Refer to User Management guide for this code -->
  
<!-- FRIENDS SYNC CODE -->
  
<script>
var chat_friends = '2,3,4,5,6'; 
</script>

<!-- LAUNCH ATOMCHAT CODE -->
  
<!-- Refer to Launch AtomChat page for this code -->


Sync Friends Via Javascript

Variable

Description

Mandatory

chat_friends

Comma-separated UIDs of each friend

Yes


NOTE: 
To verify if friends are being identified, go to your AtomChat Admin Panel -> Users -> Select a user -> Edit to view the friends.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article