Bug 45400 - WockyPepService::changed should include the <items> node (or more)
Summary: WockyPepService::changed should include the <items> node (or more)
Status: RESOLVED FIXED
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/wj...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks: 33911
  Show dependency treegraph
 
Reported: 2012-01-30 06:22 UTC by Will Thompson
Modified: 2012-01-31 09:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Will Thompson 2012-01-30 06:22:06 UTC
WockyPepService::changed fires when a <message> stanza matching the following is received:

      '(', "event",
        ':', WOCKY_XMPP_NS_PUBSUB_EVENT,
        '(', "items",
          '@', "node", priv->node,
        ')',
      ')',

In practice, PEP change notifications always contain something like this:

  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='http://jabber.org/protocol/tune'>
      <item>
        <tune xmlns='http://jabber.org/protocol/tune'>
          <artist>Gerald Finzi</artist>
          <length>255</length>
          <source>Music for "Love's Labors Lost" (Suite for small orchestra)</source>
          <title>Introduction (Allegro vigoroso)</title>
          <track>1</track>
        </tune>
      </item>
    </items>
  </event>

  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='http://jabber.org/protocol/geoloc'>
      <item id='d81a52b8-0f9c-11dc-9bc8-001143d5d5db'>
        <geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
          <accuracy>20</accuracy>
          <country>Italy</country>
          <lat>45.44</lat>
          <locality>Venice</locality>
          <lon>12.33</lon>
        </geoloc>
      </item>
    </items>
  </event>

It would be much more useful for code listening for ::changed if WockyPepService did the hard work of drilling down to the <item/> node (if any) for them—or possibly even to its child—and passed the relevant WockyNode * to the signal handler.
Comment 1 Will Thompson 2012-01-30 09:32:43 UTC
Here's a branch.
Comment 2 Simon McVittie 2012-01-30 10:22:42 UTC
My only objection to this branch is that XEP-0060 suggests that the last item might be a better choice than the first, although tbh it's pretty vague, and I'm quite prepared to believe that in the real world, nobody publishes multiple items at once.

Care to review Bug #43992 while you're in Wocky-land?
Comment 3 Will Thompson 2012-01-31 02:34:01 UTC
(In reply to comment #2)
> My only objection to this branch is that XEP-0060 suggests that the last item
> might be a better choice than the first, although tbh it's pretty vague, and
> I'm quite prepared to believe that in the real world, nobody publishes multiple
> items at once.

PEP is a subset of PubSub. Every PEP-based XEP publishes one item per node. Every PEP implementation in Gabble publishes and looks for the first item.
Comment 4 Simon McVittie 2012-01-31 07:54:19 UTC
(In reply to comment #3)
> PEP is a subset of PubSub. Every PEP-based XEP publishes one item per node.
> Every PEP implementation in Gabble publishes and looks for the first item.

OK, I'm convinced.
Comment 5 Will Thompson 2012-01-31 09:06:16 UTC
Thanks, merged.


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.