[ejabberd] Affiliates publishing to a PEP node

Theo Cushion theo at jivatechnology.com
Wed Nov 11 14:34:48 MSK 2009


Hi

I'm having difficulty getting a third party to post to a users PEP  
node using 2.5.0-rc2.

My use case is XEP-0049 Private XML Storage, but I need a bot to be  
able to update the information stored here.

So far the user can add the bot as an owner with:

<iq type='set'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
     <affiliations node='storage:foo'>
       <affiliation jid='bot at ejabberd.local' affiliation='owner'/>
     </affiliations>
   </pubsub>
</iq>

This works as when I request a list of affiliations I get:

<iq from="theo.cushion at ejabberd.local" type="result" to="theo.cushion at ejabberd.local 
/macbook" >
   <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
   <affiliations node="storage:foo" >
     <affiliation affiliation="owner" jid="bot at ejabberd.local" />
     <affiliation affiliation="owner"  
jid="theo.cushion at ejabberd.local" />
   </affiliations>
   </pubsub>
</iq>

However when I try to post to this node as the bot:
<iq type='set' from='bot at ejabberd.local' to='ejabberd.local'>
   <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <publish node='storage:foo' jid='theo.cushion at ejabberd.local'>
       <item>
         <stuff>
	  bar
         </stuff>
       </item>
     </publish>
     <publish-options>
       <x xmlns='jabber:x:data' type='submit'>
         <field var='FORM_TYPE' type='hidden'>
           <value>http://jabber.org/protocol/pubsub#publish-options</ 
value>
         </field>
         <field var='pubsub#persist_items'>
           <value>true</value>
         </field>
         <field var='pubsub#access_model'>
           <value>whitelist</value>
         </field>
       </x>
     </publish-options>
   </pubsub>
</iq>

It posts to the bots pubsub node, not the jid specified in the  
attribute of publish

I have also tried using the tree structure and specifying the /home/ 
ejabberd.local/theo.cushion/foo (there is a pep_mapping of  
{"storage:foo", "foo"}

Any ideas?

Thanks

Theo


More information about the ejabberd mailing list