Facebook implements a power saving mode similar to google:queue, but conveniently different and undocumented. To enter sleep mode you do: <iq type="set"> <sleep xmlns="http://www.facebook.com/xmpp/suspend"/> </iq> To leave it: <iq type="set"> <wake xmlns="http://www.facebook.com/xmpp/suspend"/> </iq> There is nothing equivalent to the flush operation in the GTalk implementation, queued presence changes are flushed when we sent a wake command. The server doesn't advertise its support for this feature and there is no other Facebook-specific feature we can rely on, so we need to look at the connect-server property.
Perhaps it would be better to check is_facebook() once, rather than every time we think about changing powersaving state? We could add GABBLE_CONNECTION_FEATURES_FACEBOOK_SUSPEND and set it in connector_connected() based on the connection_disco_cb (probably outside the if/else; I don't know if Facebook is well-behaved enough to reply properly to disco queries?) or some similar place? This would make it consistent with the Google code. Is GabbleConnection:connect-server guaranteed to be set? At least on MeeGo Netbook, I think we just used { 'account': 'chat.facebook.com' } for the account parameters; and Empathy sets { 'account': 'username@chat.facebook.com' }. I would like the test to test the case where 'server' is not provided, even if this does already work.
(In reply to comment #1) > Perhaps it would be better to check is_facebook() once, rather than every time > we think about changing powersaving state? We could add > GABBLE_CONNECTION_FEATURES_FACEBOOK_SUSPEND and set it in connector_connected() > based on the connection_disco_cb (probably outside the if/else; I don't know > if Facebook is well-behaved enough to reply properly to disco queries?) or some > similar place? This would make it consistent with the Google code. I will take a look at this. > Is GabbleConnection:connect-server guaranteed to be set? At least on MeeGo > Netbook, I think we just used { 'account': 'chat.facebook.com' } for the > account parameters; and Empathy sets { 'account': 'username@chat.facebook.com' > }. I would like the test to test the case where 'server' is not provided, even > if this does already work. I think I checked this and it works fine. I can improve the test to check for this condition too.
Considering Facebook killed XMPP access in April 30, 2015, this bug is no longer relevant.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.