Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle m.audio msgtype properly #68

Open
aiomaster opened this issue Jan 2, 2020 · 1 comment
Open

Handle m.audio msgtype properly #68

aiomaster opened this issue Jan 2, 2020 · 1 comment
Assignees

Comments

@aiomaster
Copy link

Hi,

I am using the matrix-puppet-signal bridge which is based on matrix-puppet-bridge and tried to send an audio snippet with riot.
I got the following error (some parts are replaced with garbage, but you get the idea):

Error in handleMatrixEvent { Error: dont know how to handle this msgtype
    at App._handleMatrixMessageEvent (/matrix-puppet-signal/node_modules/matrix-puppet-bridge/src/base.js:1089:11)
    at App.handleMatrixMessageEvent (/matrix-puppet-signal/node_modules/matrix-puppet-bridge/src/base.js:1015:25)
    at App.handleMatrixEvent (/matrix-puppet-signal/node_modules/matrix-puppet-bridge/src/base.js:1007:19)
    at Bridge._onConsume (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/lib/bridge.js:872:26)
    at tryCatcher (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/util.js:26:23)
    at Promise.successAdapter (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/nodeify.js:23:30)
    at Promise._settlePromiseAt (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/promise.js:582:21)
    at Promise._settlePromises (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/promise.js:700:14)
    at Async._drainQueue (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
  [stack]:
   'Error: dont know how to handle this msgtype\n    at App._handleMatrixMessageEvent (/matrix-puppet-signal/node_modules/matrix-puppet-bridge/src/base.js:1089:11)\n    at App.handleMatrixMessageEvent (/matrix-puppet-signal/node_modules/matrix-puppet-bridge/src/base.js:1015:25)\n    at App.handleMatrixEvent (/matrix-puppet-signal/node_modules/matrix-puppet-bridge/src/base.js:1007:19)\n    at Bridge._onConsume (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/lib/bridge.js:872:26)\n    at tryCatcher (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/util.js:26:23)\n    at Promise.successAdapter (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/nodeify.js:23:30)\n    at Promise._settlePromiseAt (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/promise.js:582:21)\n    at Promise._settlePromises (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/promise.js:700:14)\n    at Async._drainQueue (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/async.js:123:16)\n    at Async._drainQueues (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/async.js:133:10)\n    at Immediate.Async.drainQueues (/matrix-puppet-signal/node_modules/matrix-appservice-bridge/node_modules/bluebird/js/main/async.js:15:14)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)',
  [message]: 'dont know how to handle this msgtype' } { age: 23,
  content:
   { body: 'record.amr',
     info: { mimetype: 'audio/amr', size: 123456 },
     msgtype: 'm.audio',
     url: 'mxc://mydomain/somecrypticchars' },
  event_id: '$cryptic_event_id',
  origin_server_ts: 123456789,
  room_id: '!roomid:mydomain',
  sender: '@myuser:mydomain',
  type: 'm.room.message',
  unsigned: { age: 23 },
  user_id: '@myuser:mydomain' } 

Looking in the file

async _handleMatrixMessageEvent(data) {
there is indeed no handling of m.audio type.
Only types handled are: m.text, m.notice, m.image, m.sticker and m.file.
I suggest to handle m.audio at least like a regular file upload like m.file.
What do you think?

@nr23730
Copy link
Contributor

nr23730 commented Jan 2, 2020

Hi!

You're right. m.audio is indeed not handled yet.
I think this is because most clients do no support sending voice messages with m.audio right now. The behaviour you described makes sense. I'll have a further look at this in a few weeks.

@nr23730 nr23730 self-assigned this Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants