vikram17000
vikram17000

Reputation: 453

Ejabberd module to accept / forward modified xml stanzas

I'm relatively new to ejabberd and Erlang, so apologies if this is rather basic. I'm looking to introduce new data types / elements in the message stanza (i.e. parallel to 'body') sent from the client to server and reverse. Whilst I could implement the former rather easily in my iOS client, I'm struggling to understand how do I make ejabberd understand these updated incoming messages, and what needs to be changed further to have the server be able to forward these messages on to further clients.

Would anyone be able to broadly outline what all types of changes, etc. this would incur? Or any other starting points that can help me get educated here...? Or else if there is a ready module or code that someone could show me, that'd be helpful. Afraid haven't been able to make much traction reviewing docs, etc.

If its worth it, I've compiled ejabberd 15.04 on Ubuntu and I am using an iOS client.

Thanks!

Upvotes: 3

Views: 878

Answers (1)

Mickaël Rémond
Mickaël Rémond

Reputation: 9055

XMPP is fully extensible by design. It means you can introduce new elements with custom namespace as you see fit (at the same level as body) and ejabberd will pass that unmodified to the recipient client.

You have nothing special to do on ejabberd side.

For example. an extended XMPP may look like the following (see the custom tag):

   <message
       from='[email protected]/balcony'
       id='ktx72v49'
       to='[email protected]'
       type='chat'
       xml:lang='en'>
     <body>Art thou not Romeo, and a Montague?</body>
     <custom xmlns='urn:custom:data'>Content</custom>
   </message>

Upvotes: 6

Related Questions