Init Presence

Hello dear reader.

Let’s assume I’m have channel called OrganizationChannel.

When user connect to his organization channel he received in after_join hook organization_users message, that pushes all users that belongs to his organization. After that user received presence_state message that show who currently online. It comes to my mind can’t it be accomplished with one init action for Presence.

In other words how to push List of users (init users) into Presence.track/3? Is it good idea, though, or I should keep it in separate?

UPD: I found how to init Presence, but it still question is it good idea?

Presence.init is the way to get the list. Presence.track/3 tracks a process (like the topic you are in) and just adds it to that list. So to push a list of users into track would involve a list of process PID’s and such, which is almost assuredly not what you want. :slight_smile:

I’m not entirely sure what you are trying to accomplish though?