[ejabberd] Custom PEP nodes in ejabberd

Eric Cestari eric at ohmforce.com
Thu Sep 11 19:22:14 MSD 2008


Le 11 sept. 08 à 16:14, Peter Saint-Andre a écrit :

> Eric Cestari wrote:
>
>>> Reading Jack Moffit's blog post  [1] and Microbloggling over XMPP   
>>> has
>>> given me quite a bit of inspiration :)
>>> I submitted this
>>> patch https://support.process-one.net/browse/EJAB-739, this morning.
>>> It enables mapping a PEP namespace to a specific node plugin :
>>> A user creating a PEP node in namespace urn:xmpp:microblog would  
>>> have
>>> create a node_microblog in ejabberd.
>>> That would enable us to enforce the XML in the payload, have a
>>> specific storage solution.
>
> It's not clear to me exactly what your patch does. Does it mainly  
> enforce the payload namespace/content?

Currently in ejabberd, there's only one type of node for pep, which is  
called node_pep. It does not enforce anything on the payload, and it  
does not store any items other than the last one.
For microblogging, that was a bit short ;)
With this patch one can write a plugin specifically for the urn:xmpp:microblog 
  node, which could :
- store an unlimited number of tweets
- enforce payload content (doing a few checks, updating the payload  
with the itemid and related links)
- send the payload to the search engine for indexing
- ...

So it's not useful in itself, but should ease future PEP development  
on ejabberd. (and that future looks bright in my opinion :)

I have ported my Atom-PubSub code to publish the urn:xmpp:microblog  
node over Atompub, successfully tested with MarsEdit, NetNewsWire and  
the Atom Protocol Exerciser.

Now I'd need https://support.process-one.net/browse/EJAB-560 to be  
applied on trunk, because that would be easier for others to install  
this code.


>
>
>>> [2] http://www.xmpp.org/extensions/inbox/microblogging.html
>
> Clearly we need to publish that as a real XEP.

Yes please !

>
>
> BTW, I've noticed that services like identi.ca send a microblogging  
> message in multiple formats -- typically plaintext message body,  
> XHTML-IM, and Atom. Perhaps it would be helpful to describe and  
> codify that approach somewhat.

  That's interesting. BTW for the moment, having the message body  
containing the tweet along with the pubsub element is a neat idea but :
- ejabberd mod_pubsub won't let me do that for the moment
- would it be filtered out by entity capabilities on the server? (I  
had to manually add in the ejabberd database that yes Psi would  
understands urn:xmpp:microblog so that I get my notifications)
Or maybe have in caps a code for specifying how the payload should be  
transformed before sending to the client ?
no caps : plaintext
urn:xmpp:microblog+notify : Atom
urn:xmpp:microblog+notify-xhtml : should be transformed as xhtml

Eric



More information about the ejabberd mailing list