Bug 26014

Summary: gateway registration plugin doesn't actually exchange subscriptions
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: gabbleAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-gabble-smcv.git;a=shortlog;h=refs/heads/gateway-presence
Whiteboard: review+ish
i915 platform: i915 features:

Description Simon McVittie 2010-01-12 11:16:02 UTC
[Placeholder bug so I remember what I'm doing next...]

The gateway registration plugin in plugins/gateway.c doesn't complete the registration process by exchanging subscriptions with the gateway service. It should.
Comment 1 Simon McVittie 2010-01-22 08:10:26 UTC
I believe this is ready for review.
Comment 2 Simon McVittie 2010-02-22 04:32:08 UTC
I've rebased the branch on current master, incorporating wjt's improvements to error handling. We should get this merged for interoperability with Fargo.
Comment 3 Will Thompson 2010-02-22 10:16:08 UTC
When you're normalizing, why not do:

if (!wocky_decode_jid (gateway, &node, &domain, &resource))
  blow up;

if (node != NULL || resource != NULL)
  blow up;

rather than manually looking for @ and / yourself? Maybe this would actually make the code longer.

I could possibly be convinced that wocky_decode_jid() should blow up itself if the node param is NULL but the jid has a node...

+      /* attempt to subscribe to the gateway's presence (FIXME: is this
+       * harmless if we're already subscribed to it?) */

Yeah, I think it is.

Comment 4 Simon McVittie 2010-02-22 11:00:44 UTC
(In reply to comment #3)
> When you're normalizing, why not do:
> 
> if (!wocky_decode_jid (gateway, &node, &domain, &resource))
>   blow up;
> 
> if (node != NULL || resource != NULL)
>   blow up;
> 
> rather than manually looking for @ and / yourself? Maybe this would actually
> make the code longer.

I think it would, due to having to free node and resource on the error path.

> I could possibly be convinced that wocky_decode_jid() should blow up itself if
> the node param is NULL but the jid has a node...

We discussed the possibility of having a special value WOCKY_JID_COMPONENT_FORBIDDEN (or something), which would be #defined to (((char *) NULL) + 1) or some such, and would have these semantics.

For now I'm just going to merge this.

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.