Bug 26100

Summary: use the decloak proto-XEP
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: fargoAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: David Laban <david.laban>
Severity: enhancement    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
URL: http://xmpp.org/extensions/inbox/decloak.html
Whiteboard: milestone4.6
i915 platform: i915 features:

Description Simon McVittie 2010-01-18 07:29:57 UTC
There's now a proto-XEP for Rob and psa's "decloaking" / "smoking out presence" extension, with an implementation in Gabble. Fargo should implement it too.
Comment 1 Simon McVittie 2010-01-21 09:33:57 UTC
+        if xpath.matches("/presence/decloak", stanza):

Check the xmlns, please.

+        # FIXME: if a client sends a directed unavailable after they make a
+        # call, currently we just log out. What we should probably do instead
+        # is only listen to presence update/subscribe on the gateway JID and
+        # ignore presence to virtual users for logging in/out.

Er, yes, that. I predict that to handle this sort of thing correctly, we'll end up with two completely separate sets of callbacks: one for user@gateway, and one for the gateway itself.

+        # Also, this identity is shared by our virtual users. Hope this is ok.

I think the gateway and the individual users should have distinct caps and perhaps also identity. After all, you can't Jingle-call <gw.example.com>, only <bob%example.net@gw.example.com>, so gw.example.com shouldn't have Jingle caps.

+        # NOTE: We assume here that they are querying us for our caps, and
+        # therefore don't bother checking that the caps are the same.

Um...

+        c['node'] = 'http://telepathy.freedesktop.org/wiki/fargo'

/Fargo has the benefit of actually existing :-P

> +import ns

Absolute imports, please: import telepathy_fargo.ns as ns. Rationale: http://www.python.org/dev/peps/pep-0328/

(Perhaps we should switch on "from __future__ import absolute_import" in all modules, since AIUI we require Python 2.5 anyway?)

Do you want to merge up your branch and I'll do these fixes myself?
Comment 2 Simon McVittie 2010-01-21 09:35:06 UTC
Sorry, those comments were regarding <http://git.collabora.co.uk/?p=user/alsuren/telepathy-fargo.git;a=shortlog;h=refs/heads/caps>.
Comment 3 Simon McVittie 2010-01-22 07:14:14 UTC
(In reply to comment #1)
> Check the xmlns, please.

Fixed in my caps branch.

> 
> +        # FIXME: if a client sends a directed unavailable after they make a
> +        # call, currently we just log out. What we should probably do instead
> +        # is only listen to presence update/subscribe on the gateway JID and
> +        # ignore presence to virtual users for logging in/out.
> 
> Er, yes, that. I predict that to handle this sort of thing correctly, we'll end
> up with two completely separate sets of callbacks: one for user@gateway, and
> one for the gateway itself.

Done for IQs in my caps branch; still to be fixed for presences.

> +        # Also, this identity is shared by our virtual users. Hope this is ok.
>
> I think the gateway and the individual users should have distinct caps and
> perhaps also identity. After all, you can't Jingle-call <gw.example.com>, only
> <bob%example.net@gw.example.com>, so gw.example.com shouldn't have Jingle caps.

Still to be fixed.

> +        # NOTE: We assume here that they are querying us for our caps, and
> +        # therefore don't bother checking that the caps are the same.
> 
> Um...

To be fixed.

> +        c['node'] = 'http://telepathy.freedesktop.org/wiki/fargo'
> 
> /Fargo has the benefit of actually existing :-P

Fixed in my caps branch.

> > +import ns
> 
> Absolute imports, please

Fixed in my caps branch.

Some other problems related to presence/disco/caps handling:

* TelepathyService.got_iq assumes that @to will either be the gateway or one of our virtual users, not some other address (just FIXME'd for now)

* needs regression tests!

* presence probes aren't implemented (Bug #26141)
Comment 4 Simon McVittie 2010-01-22 09:48:01 UTC
This branch still doesn't address my complaints, but it fixes some other nits regarding caps, and adds the beginning of regression test coverage for presence and probes.

http://git.collabora.co.uk/?p=user/smcv/telepathy-fargo.git;a=shortlog;h=refs/heads/caps
Comment 5 Simon McVittie 2010-01-25 10:05:48 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > Er, yes, that. I predict that to handle this sort of thing correctly, we'll end
> > up with two completely separate sets of callbacks: one for user@gateway, and
> > one for the gateway itself.

Fixed in master.

> > I think the gateway and the individual users should have distinct caps and
> > perhaps also identity. After all, you can't Jingle-call <gw.example.com>, only
> > <bob%example.net@gw.example.com>, so gw.example.com shouldn't have Jingle caps.

Fixed in master.

> > +        # NOTE: We assume here that they are querying us for our caps, and
> > +        # therefore don't bother checking that the caps are the same.
> > 
> > Um...

Bug #26216.

> > +        c['node'] = 'http://telepathy.freedesktop.org/wiki/fargo'
> > 
> > /Fargo has the benefit of actually existing :-P

Fixed in master.

> > > +import ns
> > 
> > Absolute imports, please

Fixed in master.

> * TelepathyService.got_iq assumes that @to will either be the gateway or one of
> our virtual users, not some other address (just FIXME'd for now)

Bug #26204 (which is just for robustness - the host ejabberd shouldn't forward stanzas that would fail that check anyway)

> * needs regression tests!

Fixed in master.

> * presence probes aren't implemented (Bug #26141)

Fixed in master.

I'm going to consider this done, modulo the parts that have been spun out as separate bugs.

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.