Bug 38943 - Implement Facebook's power saving mode
Summary: Implement Facebook's power saving mode
Status: RESOLVED WONTFIX
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Marco Barisione
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/ba...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-07-04 03:37 UTC by Marco Barisione
Modified: 2016-07-06 23:40 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marco Barisione 2011-07-04 03:37:08 UTC
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.
Comment 1 Will Thompson 2011-07-05 10:20:39 UTC
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.
Comment 2 Marco Barisione 2011-07-05 10:33:28 UTC
(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.
Comment 3 diane 2016-07-06 23:40:52 UTC
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.