Bug 78147

Summary: can not become invisible with 0.16.7 on google talk
Product: Telepathy Reporter: mehmet.giritli
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED NOTABUG QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: gabble debug log

Description mehmet.giritli 2014-05-01 09:34:14 UTC
I'm running gnome 3.10 and empathy with gabble-0.16.7 and trying to become invisible with empathy puts me back to busy. Trying to become invisible from within gmail webpage, it says that I'm logged in from somewhere which does not support being invisible, but otherwise it works.

This used to be perfectly working before but it does not seem to anymore.

I'd also add some log files but doen't really know how to get them.
Comment 1 Andrés Becerra Sandoval 2014-05-21 15:22:44 UTC
I am having the same problem with kde-telepathy-0.8.1 and telepathy-gabble-0.18.2.

If I set my state to invisible in google talk, the state as viewed by my contacts is busy.
Comment 2 Simon McVittie 2014-05-26 10:14:13 UTC
Some links to debugging/logging information:

https://wiki.gnome.org/Apps/Empathy/Debugging
http://telepathy.freedesktop.org/wiki/Debugging/

I suspect the problem might be that Google have changed their "shared status" API (which is how Gabble tries to become invisible on Google servers). The latest version documented by <https://developers.google.com/talk/jep_extensions/shared_status> is 2, which is what Gabble implements... but perhaps there's an undocumented version 3?
Comment 3 mehmet.giritli 2014-05-26 19:26:06 UTC
Created attachment 99887 [details]
gabble debug log

Thanks for the tips Simon. Hope the debug log helps identify the problem at least..
Comment 4 Simon McVittie 2014-05-26 20:08:23 UTC
The only way in which we can become invisible on GTalk is to use Google's proprietary "shared status" extension, which only works if all your resources are invisible. (If not all of your resources are invisible, then your overall presence is still visible, and there's nothing Gabble can do about that.)

The server claims to support shared-status:

wocky/-DEBUG: 26/05/14 19:20:40.250658: _end_element_ns: Received stanza
* iq xmlns='jabber:client' to='mehmet.giritli@gmail.com/501201df' from='gmail.com' id='37892851482' type='result'
    * query xmlns='http://jabber.org/protocol/disco#info'
        * identity category='server' type='im' name='Google Talk'
        * feature var='http://jabber.org/protocol/disco#info'
...
        * feature var='google:shared-status'
...

so we ask what shared status we have:

wocky/-DEBUG: 26/05/14 19:20:40.251440: _write_node_tree: Serializing tree:
* iq xmlns='jabber:client' type='get' to='mehmet.giritli@gmail.com' id='234508251357'
    * query xmlns='google:shared-status' version='2'
...
wocky/-DEBUG: 26/05/14 19:20:40.809276: _end_element_ns: Received stanza
* iq xmlns='jabber:client' to='mehmet.giritli@gmail.com/501201df' from='mehmet.giritli@gmail.com' id='234508251357' type='result'
    * query xmlns='google:shared-status' status-min-ver='0' status-max='512' status-list-max='3' status-list-contents-max='5'
        * status
        * show
            "default"
        * status-list show='default'
            * status
                "♫ Metallica - Blackened ♫"
        * status-list show='dnd'
        * invisible value='false'

According to Google's docs, status-min-ver='0' means at least one of your other resources that is signed-in to the same account doesn't support invisibility, so you can't be invisible, as summarized here in the Gabble source code:

  /* - status-min-ver == 0 means that at least one resource doesn't support
   *   Google shared status, so we fallback to "dnd".
   * - status-min-ver == 1 means that all the resources support shared
   *   status, but at least one doesn't support invisibility; we have to fall
   *   fall back to "dnd".
   * - status-miv-ver == 2 means that all the resources support shared status
   *   with invisibility.
   * - any other value means that the other resources will have to fall back
   *   to version 2 for us. */
  priv->shared_status_compat =
    (g_strcmp0 (min_version, "0") != 0 && g_strcmp0 (min_version, "1") != 0);

It appears your only other resource is some Android client, presumably a discontinued Google Talk for Android client that has been superseded by Hangouts. (Hangouts are not interoperable with standard XMPP, unfortunately.)

wocky/-DEBUG: 26/05/14 19:20:41.372495: _end_element_ns: Received stanza
* presence xmlns='jabber:client' from='mehmet.giritli@gmail.com/MessagingA6c2a8e07' to='mehmet.giritli@gmail.com/501201df'
    * show
        "away"
    * c xmlns='http://jabber.org/protocol/caps' node='http://www.android.com/gtalk/client/caps' ver='1.1'
    * x xmlns='vcard-temp:x:update'
        * photo
            "98d12cf8de86a37b57471a778059197966a7508f"

Mehmet: please sign out from that client (i.e. turn off GTalk on your phone?) and try again. Gabble should hopefully gain the ability to be invisible.

Andrés: similarly, please sign out / turn off any other resources logged in to that same GTalk account. You should be able to be invisible. If necessary, turn on other resources one by one to see which one breaks it.
Comment 5 mehmet.giritli 2014-05-28 08:59:44 UTC
I wasnt able to do it with my phone. But I found and applied this trick which did it:

http://karthikkn.wordpress.com/2013/07/16/fixed-the-always-online-problem-with-google-chat/

I still don't know what that extra session was. I don't think it was my phone as I completely removed all google accounts from it just to fix this issue...

Anyway, thanks for the tips Simon.
Comment 6 Simon McVittie 2014-05-28 10:31:25 UTC
(In reply to comment #5)
> I still don't know what that extra session was. I don't think it was my
> phone

Possibly your phone dropped off the network but Google's server still thought it was connected; or possibly it was some non-phone client deliberately pretending to be Android GTalk client v1.1 for whatever reason. The last DEBUG stanza I quoted is all we can know about it, unfortunately.

(Gabble identifies itself in XMPP "capabilities" as http://telepathy.freedesktop.org/xmpp/caps or something, not as http://www.android.com/gtalk/client/caps like your other session did, so it wasn't a stale Gabble session.)
Comment 7 mehmet.giritli 2014-05-28 11:01:45 UTC
The problem is back. The session is reopened, with the same resource id. Googling around showed that it is hangouts-related. Google seem to do this on its own. I actually uninstalled it from my phone but google opens a hangouts session on its own. Bloody hell!

http://blog.vucica.net/2013/10/spurious-nonresponsive-xmpp-resource-messaging-xxxxxxx-under-google-talkhangouts.html

"So yes, Google Hangouts stays connected even if the device you’ve logged into from is not. Apparently this is a connection that’s created internally, inside Google, from their Hangouts service to their Talk service — from the new IM tech to the XMPP tech. And if you try to trick the XMPP service to sign out Hangouts (for example, by creating a new connection with identical XMPP resource), the Hangouts will happily log back into XMPP in your name and present you as ‘away’. And messages intended to be stored offline will end up in Hangouts, never to be seen again unless you use Hangouts on other systems."
Comment 8 mehmet.giritli 2014-05-28 19:17:49 UTC
Okay, it seems to be fixed finally. So, even tough you disconnect or even uninstall hangouts, there remains a permanent session in google servers it seems. You can sign out from the hangouts app in your phone and the session will be ended.

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.