Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

add support of button in message #4885

Closed
progserega opened this issue Mar 19, 2019 · 3 comments
Closed

add support of button in message #4885

progserega opened this issue Mar 19, 2019 · 3 comments
Labels
z-feature (Deprecated Label) z-p3 (Deprecated Label)

Comments

@progserega
Copy link

Add feature, that allow add some number of buttons to each message. When user press on button on message in his matrix-client - matrix-client must send some command to user, which send this message.

For example:

  1. Bot with name "ticket_bot" send message to user with text "new ticket X in status NEW" with button "accept ticket"
  2. User in matrix-client press to button "accept ticket"
  3. Matrix client send to bot some command-message: "@ticket_bot button_1_cmd mesage_id=matrix_event_id
  4. bot "ticket_bot" receive this text, parse matrix_message by id and set ticket X to state "process by user"

Another way (today) user must send special command to user and send ticket id as parameter, or answer for this bot-message and send command "!accept" (or other text) - then bot process it. This is to hard for users especially on mobile devices when users work at outdoor.

So I think may be add support such json to message:

{
  "sender": "@ticket_bot:matrix.org",
  "origin_server_ts": 1551346185711,
  "unsigned": {
    "age": 304684070
  },
  "event_id": "$15514343553530ufHCY:matrix.org",
  "type": "m.room.message",
  "content": {
    "body": "new ticket 12 in status NEW",
    "msgtype": "m.text",
    "buttons":{
       "button_1_cmd":{
          "label":"accept ticket",
          "order":1,
          "color":"#545466
        }
     }
  },
  "room_id": "!kLqhMfsdfsdfsdfgIB:matrix.org"
}

order - this is for sort buttons in message

@neilisfragile
Copy link
Contributor

This behaviour would require a spec change and would be better raised in https://github.com/matrix-org/matrix-doc

I'll keep it open here for now.

@neilisfragile neilisfragile added z-p3 (Deprecated Label) z-feature (Deprecated Label) labels Mar 19, 2019
@richvdh
Copy link
Member

richvdh commented Mar 19, 2019

@richvdh richvdh closed this as completed Mar 19, 2019
@progserega
Copy link
Author

progserega commented Mar 20, 2019

I think this is matrix-org/matrix-doc#824

yes, sorry for the double feature request

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-feature (Deprecated Label) z-p3 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

3 participants