XEP-0221: Data Forms Media Element support request

Smack has implemented XEP-0004: Data Forms version 2.9 standard.
However in XEP-0158: CAPTCHA Forms documents, its defined stanza may contain media element i.e. XEP-0221: Data Forms Media Element in the Form Field of the Data Forms.

Each CAPTCHA field MAY contain a media element (see Data Forms Media Element (XEP-0221) [13]) that in turn contains a pointer to media that the sender shall use in solving puzzles, performing optical character recognition, identifying audio or video samples, etc.

Current implemented Data Forms extension in Smack does not provide a way to retrieve the media element from the form field. Appreciate if smack team would consider adding the support to allow app to retrieve the media element for processing.

I think the DataFormProvider doesn’t yet support child elements of fields. That would need to get patched afaics. @Flow should we open a Jira issue for this?

Are there any implementations that send xep221 elements in the wild? Are there other xeps that extend data forms like xep221 does?

ejabberd also extends XEP-0221 to XEP-0077: In-Band Registration as shown in the below stanza captured on aTalk. aTalk has implemented a light support for IBR registration with CAPTCHA.

`07-21 18:27:39.869 26334-26018/org.atalk.android D/SMACK: RECV (5):
<iq xml:lang='en' from='atalk.org' type='result' id='maSJe-1045'>
<query xmlns='jabber:iq:register'><x type='form' xmlns='jabber:x:data'><instructions>Choose a username and password to register with this server</instructions>
<field var='FORM_TYPE' type='hidden'><value>urn:xmpp:captcha</value></field>
<field var='username' type='text-single' label='User'><required/></field>
<field var='password' type='text-private' label='Password'><required/></field>
<field type='fixed'><value>If you don&apos;t see the CAPTCHA image here, visit the web page.</value></field>
<field var='captchahidden' type='hidden'><value>workaround-for-psi</value></field>
<field var='url' type='text-single' label='CAPTCHA web page'><value>http://atalk.sytes.net:5280/captcha/16918692297641115404/image</value></field>
<field var='from' type='hidden'><value>atalk.org</value></field>
<field var='challenge' type='hidden'><value>16918692297641115404</value></field>
<field var='sid' type='hidden'><value>maSJe-1045</value></field>
<field var='ocr' type='text-single' label='Enter the text you see'>
<media xmlns='urn:xmpp:media-element'><uri type='image/png'>cid:sha1+5a384735ddab864b9615c01aed65108ffa21bdb6@bob.xmpp.org</uri></media><required/></field></x>
<data type='image/png' max-age='0' cid='sha1+5a384735ddab864b9615c01aed65108ffa21bdb6@bob.xmpp.org' xmlns='urn:xmpp:bob'>iVBORw0KGgoAAAANSUhEUgAAAIwAAAA8CAAAAACRYQ2XAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4AskbKACDj6EYAWGvzrkFSPaBrj1bt0lsJcWOsQHpfCV8bg1gi3tBwr83QYuzGTpeziDRCfWBIWxzi6j8hMFcYpTpORESVhURElNVIRES55Uk/3qqp7no1`

Created SMACK-824.

1 Like