Bug 26014 - gateway registration plugin doesn't actually exchange subscriptions
Summary: gateway registration plugin doesn't actually exchange subscriptions
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard: review+ish
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-01-12 11:16 UTC by Simon McVittie
Modified: 2010-02-22 11:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.