hibobmaster / matrix-stt-bot

A simple matrix bot that transcribes your voice to text message
https://matrix.to/#/#public:matrix.qqs.tw
MIT License
20 stars 3 forks source link

Encrypted messages are in format m4a and are silently not processed #2

Open remoremorali opened 10 months ago

remoremorali commented 10 months ago

The code checks for audio/ogg before decoding, so audio/m4a is ignored. I'm going to submit a PR for this.

remoremorali commented 10 months ago

Actually I got it wrong: some messages are ogg and some are m4a but the problem with the encrypted messages is that the content_type is application/octet-stream. The event mimetype is correct though, so using that one works.

alexander-potemkin commented 9 months ago

@remoremorali , I'm facing an issue with encrypted audio message not processed at all, so I guess it's exactly the issue you are mentioning. Did you have a chance to submit a PR? If not, would you mind advising on the code place to make the changes?

alexander-potemkin commented 9 months ago

I figured out pull request is there and already merged (https://github.com/hibobmaster/matrix-stt-bot/pull/3).

@hibobmaster , could you please, help me to understand if encrypted rooms ever worked for you? I have only Element clients and bot just doesn't get triggered on audio messages in encrypted rooms.

I have encryption configured and working, non-encrypted rooms also works fine.

alexander-potemkin commented 9 months ago

I've changed events to listen to as broad range as possible:

        # setup event callbacks
        self.client.add_event_callback(
            self.message_callback,
            (
                RoomMessageAudio,
                RoomEncryptedAudio,
                RoomMessage,
                RoomMessageUnknown,
                RoomEncryptedMedia,
                UnknownEncryptedEvent,
                Event,
            ),
        )

But it still doesn't work - I'm running the code under the debugger and it just not executing this code for encrypted rooms.

One more thing that concerns me, it's that bot never 'read' those messages - it's like something prevents it from getting those messages ever touch the code.

... and one more thing... it's not only with encrypted channels - it's with any channels, except for default's '#discuss'. The bot joining all those rooms, but never get the messages.

hibobmaster commented 9 months ago

@alexander-potemkin You should import E2EE room keys follow the readme.

And here's a guide about how to login via access_token and make it work in E2EE room. https://github.com/hibobmaster/matrix-stt-bot/issues/4#issuecomment-1840398688

alexander-potemkin commented 9 months ago

@hibobmaster , thank you - I've commented on #4 regarding session key. What confuse me, it's that things doesn't work on un-ecrypted room as well.