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
How to get the current date for created_at when create a Multi-User Chat. #4202
Comments
This column got repurposed, and now it keeps info about date of room hibernation (or sentinel value of 1970 when room is alive). |
So what you see here is correct behaviour per current code. |
In case I want to know when this room was created, where can I get it? @prefiks |
You can't any more. |
By the way, can you tell me? Can I get a list of members in the room with their roles via admin api ? |
You probably could use |
yes, i got it. But i get nothing when user disconnect. |
So you don't want to see roles but what affiliations are stored in a room (roles are only set for online users). Check https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#get-room-affiliations |
Yeah, thanks so much. I also get another issue. Please help me. When i join a room or send a message, it's created many chat records in archive for all users in room like the image below. kind = chat and txt is empty. Please see last 4 records. this room have 3 members. i connect with user 1 (owner) and user 2, user 3 are members. Please.... |
What those messages contain? Could you expand xml of one of those? They look like messages to individual room member (and not sent to all members of a room), and as such are stored in sender and recipient archive. |
This message have type "chat" so it's handled like regular message between two peers (as it in fact is), so it get stored in recipient and sender archive. What do you expect to happen with those message, they never get stored? |
But obviously I sent it to the room as a groupchat kind. and i understand everybody in this room will received it. I think it needs content saved in txt and kind is groupchat. Suppose I want to get the chat history of user3 in room2 from the last message at (timestamp). How can i do it? |
Ah, those are mucsub events that are generated for muc messages. This is how mucsub works, it notifies subscribers that aren't in room, by sending those. And those message are allowed to be stored in archive or offline storage, because this is only way that offline user can know about those. |
thanks @prefiks. Let's me clarify something
|
Generally you don't need to parse anything, as there is already code in ejabberd that handles all this in mod_mam module, that respond to request described in https://xmpp.org/extensions/xep-0313.html. Are you trying add external management of those outside ejabberd? |
I'm talking with ejabberd by golang. and clients (Web/App) connect with Chat Service (golang) and use go xmpp library https://pkg.go.dev/github.com/xmppo/go-xmpp |
Then you should send something like this: https://xmpp.org/extensions/xep-0313.html#filter-time (ideally example 8 from that), with time from last message that you seen, and you should receive messages that were archived after that one. |
Thanks @prefiks, let's me try. |
I created a room with API https://docs.ejabberd.im/archive/24_02/admin-api/#create-room-with-opts . But column created_at in table muc_room was not getting the current date.
Help me fix this. Please.
The text was updated successfully, but these errors were encountered: