GregSutcliffe / maubot-meetings

A Maubot plugin for running meetings in Matrix
Other
9 stars 5 forks source link

use an event handler rather than the passive command handler to log messages #23

Closed ryanlerch closed 11 months ago

ryanlerch commented 1 year ago

Previously, we were doing some fudgery to log messages as the result of commands from the meetings plugin. This however, was not caused by the bot not being able to passively record messages it sends, but by the fact that command only, by default works on MessageType.TEXT, and when you send a message from a maubot plugin with evt.reply or evt.respond, it is hard coded to send the message as MessageType.NOTICE.

So this commit removes all the fudgery, and tells the passive logging command to also look at the NOTICE message type.

ryanlerch commented 12 months ago

Ok -- i'll need to rethink this -- its now logging messages from other bots (zodbot in my case) -- but now not logging its own messages -- may need to return the fudgery

ryanlerch commented 12 months ago

Ok -- i'll need to rethink this -- its now logging messages from other bots (zodbot in my case) -- but now not logging its own messages -- may need to return the fudgery

figured it out! updated the commit (and the message):

use an event handler to log messages rather than passive handler
Previously, we were doing some fudgery to log messages as the result of
commands from the meetings plugin. (or from other maubot plugins)
This was caused by the passive handler not processing messages from the
bot itself, and the passive handler not processing messages of type
NOTICE (which maubot's evt.reply sends messages as)

So this commit removes all the fudgery, and adds a event handler on all
room messages of type NOTICE and TEXT to log messages.
GregSutcliffe commented 11 months ago

Merged as ed2454f28899f1fb210f18f33c8d7cb81603e644, thanks so much @ryanlerch :tada: