Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#2225 closed enhancement (fixed)

[PATCH] please support jabber:x:data in message elements

Reported by: asac@… Owned by: asterix
Priority: normal Milestone: 0.12
Component: None Version:
Severity: normal Keywords:
Cc: asac@…, gajim@…, ka-el@… Blocked By:
Blocking: OS: All

Description

Currently, jabber:x:data forms embedded in message stanzas are not supported by gajim. Since this feature is mentioned to be valid in JEP-0004 I would like to see this implemented.

The patch attached is an initial try, which is based on the ad_hoc branch.

It displays dataform widgets in SingleMessageWindow? and submits filled in values if Send or Send & Close gets clicked.

If you want me to provide something similar for the trunk, let me know!!

Thanks for considering this.

Attachments (1)

message_forms.patch (7.6 KB) - added by asac@… 10 years ago.
(single) message data form support

Download all attachments as: .zip

Change History (16)

Changed 10 years ago by asac@…

(single) message data form support

comment:1 Changed 10 years ago by asterix

this sounds interesting, could you give me an exemple where it is used so

I can test it ?

it seems forms can also be in messages of type 'chat'

comment:2 Changed 10 years ago by nk

Asac, ping?

comment:3 Changed 10 years ago by anonymous

Replying to nk:

Asac, ping?

Sorry for the silence ... I have a hand crafted agent written in java which sends out messages with forms embedded. I have currently no idea how to bring it online. As I am currently under heavy load I can pick up this ball in a month ... but not before. Sorry.

comment:4 Changed 10 years ago by jim++

Ding dong :D

comment:5 Changed 10 years ago by jim++

  • Type changed from defect to enhancement

comment:6 follow-up: Changed 10 years ago by asterix

  • Milestone set to 0.12

it seems also possible to have in a message both a text and a form, so both should be visible.

if you could make your bot public or tell me where I can find the sources and an easy way to try this, that would be usefull.

comment:7 in reply to: ↑ 6 Changed 9 years ago by gajim@…

  • Cc gajim@… added
  • OS set to All

Replying to asterix:

it seems also possible to have in a message both a text and a form, so both should be visible.

if you could make your bot public or tell me where I can find the sources and an easy way to try this, that would be usefull.

When a message has a namespaced child, a present <body/> is for graceful degradation when that namespaced child is not recognized by the client. A form would most likely be a richer representation of a piece of data or interaction, and the body could have a plain-text rendering or e.g. a pointer to a web page that provides the same kind of information exchange as a fallback.

A client should never display both.

comment:8 Changed 9 years ago by asterix

hmmm why not ? message could be "Hey man fill this form please" and an attached form. In this case both should be shown.

did you see that somewhere ? Else I'll write a mail to standards ML to be fixed

comment:9 Changed 9 years ago by gajim@…

The idea of Data Forms as a direct child of a <message/> stanza is that it stands on its own, much like for example XHTML-IM. You can embed an instruction like 'Hey man fill this form please' in the <instructions/> element inside the form. It is not like an attachment.

Just like XHTML-IM, the <body/> is the plain-text fallback in case the recipient does not understand the jabber:x:data namespace (in this context). Although you can detect support for the namespace, this may happen when a message is stored offline and is then received by another client.

I am not sure what you mean with 'to be fixed'.

comment:10 Changed 9 years ago by asac@…

I think using the <body/> element for degrading is reasonable ...

Unfortunately, my bot has died and since I don't run java anymore, I would rather add this functionalety to an existing java bot. Any suggestions for a (python?) bot that I could use to add this testcase with little effort?

comment:11 Changed 9 years ago by asac

ouch ... typo alert ... it should read:

Unfortunately, my bot has died and since I don't run java anymore, I would rather add this testcase to an existing bot ...

comment:12 Changed 9 years ago by asterix

  • Resolution set to fixed
  • Status changed from new to closed

(In [94880811eef86d062980b27e9b5a1aba50a11a19]) [asac] support jabber:x:data in message elements. fixes #2225

comment:13 Changed 9 years ago by asterix

neutron is a python bot: http://www.ejabberd.im/neutron

I added a plugin to my bot to test your patch. it's bot@…, send him !form and he'll send you a form :)

I've updated patch to work with current svn and it seems to work fine.

comment:14 Changed 8 years ago by ka-el@…

  • Cc ka-el@… added

I mistakenly opened a second bug report #4242 because the following message is not handled by Gajim whereas it is by Psi :

<message to='john.doe@example.com' type='headline' id='7'>
  <x xmlns='jabber:x:data'>
    <title>Select type of operation</title>
    <instructions>Test</instructions>
    <field var='title' type='text-single' label='Title'>
    <required/>
    <desc>Title</desc>
    <value>Foobar</value>
    </field>
  </x>
</message>

comment:15 Changed 8 years ago by asterix

indeed dataforms are supported only in message with type=chat. It should work if in advanced configuration editor you configure treat_incoming_messages as chat.

normal and headline support will be improved in the future ...

Note: See TracTickets for help on using tickets.