Having actionable buttons in chats is apparently a fashionable thing
+now. This specification defines a simple protocol for buttons and
+responses.
+
+
+
+
+
To provide a representation of a simple button or two in a chat.
+
+
+
+
+
+
Is "button" too UI-centric?
+
+
+
Could base it on the <action> element from ad-hoc?
+
+
Styling? Maybe a few fixed styles like normal, warning, danger?
+
+
+
+
+
OPTIONAL.
+
+
+
Button
+
An actionable object that can be invoked.
+
Click
+
The act of invoking the actionable object.
+
+
+
+
+
A chat bot wants to provide fixed choice answers or commands.
+
+
+
+
+
+
A button is represented by a <button> element in the
+urn:xmpp:tmp:buttons.
+
+
+
+]]>
+
+
+
value
+
Textual payload to be sent in a message <body> when the button is
+clicked.
+
<label>
+
Text label for the button. Can be repeated per language.
+
+
+
+
+
+
+
A message with buttons is sent by including one or more <button>
+elements with distinct value attributes. At least one <label> element
+MUST be included containing a textual description for the button.
+
+
+ Approve? (yes/no)
+
+
+]]>
+
+
A single message MUST NOT have multiple buttons with the same @value.
+
+
+
+
When the user clicks a button, their client sends a plain text message
+body containing the @value as <body> text.
+
+
+ yes
+]]>
+
+
+
+
OPTIONAL. TODO.
+
+
+
+
OPTIONAL. TODO.
+
+
+
+
Accessibility for whom?
+
+
+
+
Multiple instances of the <label/> element MAY be included for the
+purpose of providing alternate versions of the same text in different
+languages, i.e. with distinct xml:lang attributes.
+
+
+
+
Do not press the big red button marked "Danger: Do Not Push".