I am working on a group chat application using ejabberd.
Usecase:
What I want to develop is a whatsapp like group chat. User once joined the group chat they must be able to receive the message until they intentionally leave the chat.
What I tried :
I configured ejabberd (from docker image ejabberd/ecs) successfully and added few users to it. I am using mysql as database. MUC module is configured so that it uses mysql to store muc rooms and users data. I tried below steps to configure rooms and users.
- Created user with
ejabberctl
- created room with
persistent true
configuration fromejabbberdctl
. - User joined the room from
xmpp client
(tried different clients) with option to automatically rejoins the room.
Assumption and actual :
My assumption was the mysql table muc_room_subscribers
would have an entry of the above user. But it is empty. The bookmark
is added to the private_storage
table and the xmpp client get this data (I assume) and rejoins the group chat once the user is reconnected. So of course my requirement meets, But I want to develop my own client. Wondering how the muc room subscription
supposed to deal.
How it is supposed to do ? :
In order to develop a group chat application, do i need to add a bookmark
for the joined room
against the user
in the background and if the user is disconnected use push notification
to notify the user and if the user reconnect then rejoin to the muc room
. Is this how it is supposed to implement?
Question about subscribe :
Then, What is the purpose of muc_subscribers? In what use case we can use this? The typical group chat (whatsapp like) doesn't need a subscription?