How to re-request list of numbers and history from muc in ejabberd

When a user joins ejabberd MUC, the server sends the user a complete list of numbers and chat history.

In my web client, I need to continue to overflow the page. My problem is that I lose the original information when the page is unloaded.

ATM I am working on this by serializing a list and room history for json and storing it in a cookie. However, this is a really bad idea (tm), as I can very quickly exceed the general 4k cookie limit for rooms with lots of users.

So the question is: How can I re-request the information that the server sends to the user when connected, without actually reconnecting the MUC?

One approach for registries is to send an iq request with the namespace "http://jabber.org/protocol/disco#items", but this is incomplete because it does not provide presence information or any extended information (such as real jeeps for not anonymous rooms)

+5
source share
3 answers

On the unloading page you need to send "presence unavailable"

When you upload to the page (return to the room) send the request "presence available" plus "history". For instance,

<history maxstanzas=20 />

XEP-0045 Scheme Reference

+1
source

Hm. I do not have a solution for Roster, but for the history of one you tried this?

<iq to="room@conference.xmpp.org" type="get">
  <history xmlns="http://www.jabber.com/protocol/muc#history" start="1970-01-01T00:00:00Z" direction="forward" count="100" />
</iq>
+1

muc muc .

0

All Articles