--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To view this discussion on the web visit https://groups.google.com/d/msg/strophe/-/oRUkNNBF6-AJ.
To post to this group, send email to str...@googlegroups.com.
To unsubscribe from this group, send email to strophe+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/strophe?hl=en.
You need to persist the roster state across the attachment. Reprobing
for presence is pretty expensive.
It's not just the roster state you will need to persist, but all
application state that you need.
jack.
Gab.connection.send($pres().c('show').t("away").up().c('status').t("-reconnecting"));
Gab.connection.send($pres());
but it didn't work. Can I pause the connection and then restart it to update the roster again on reconnecting? I don't want to save the roster state because if they reconnect after 5-20 minutes the online status of folks on their roster will be out of date, and I don't want to have to reconnect every time. Although maybe I'll have to.
Going away won't work. You have to become unavailable. When you
become available again, this will trigger the server to send out
presence probes to all your contacts, at which point they will answer
with their current presence. If you have a large roster, this can
cause a lot of network traffic. You don't see this traffic on the
client because the server is doing the work for you.
jack.
To try and present the situation from a high level...
The primary purpose of attaching to an existing session instead of
reconnecting is to avoid the necessary state sync at login (roster,
presence, MUCs, etc.). If you attach, and then want to try to get this
data sent to you again, you are more than likely doing something
wrong. Just make a new connection to the server if you don't have any
of the old state around.
There are exceptions to this rule... some applications don't really
have any state, and so it doesn't matter.
For practically all other applications, you should transfer your local
state (contact list, contact's last presence, and anything else
relevant) to the new client instance, as well as the sid+rid of the
connection. If you are going to start from a blank client, just do
that and log back in - don't try to use the old client's connection.
Regards,
Matthew
You can avoid this by not sending available presence until you've
attached with strophe. Until the first presence is sent, you are
considered unavailable.
--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To view this discussion on the web visit https://groups.google.com/d/msg/strophe/-/fH9GAYv-wo8J.