Just reminded that I could accomplish the same thing with triggering the userMessage myself. 
Not sure what the best option is :)


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Op vrijdag 30 juli 2021 om 4:42 PM schreef Jeroen van Veen <jvanveen@protonmail.com>:

Hi,

I'm working on adding context actions (groupAction/userAction) with optional custom
messages to Pyrite. After performing an action, I would like to add a notification to
all users that are affected by the action. For instance, to clear the chat, an operator would do:
"connection.groupAction('clearchat')"

Next, all users (including the operator) receive a user message (onusermessage) with kind 'clearchat', 
that triggers a notification in Pyrite. This, together with echo, is a nice central place to trigger action
notifications from. 

If I do something similar for lock, e.g. "connection.groupAction('lock')", I would now check the 
"joined" (kind "change") event for the locked status. (Would it be possible to have
the locked property in there all the time, even if it's not locked?) For record/unrecord, I would check the 
onUser event for a user with name RECORDING. 

Would it be an idea to trigger user messages for groupAction commands? This may 
be a good place to store the custom message as well? I can't seem to get
to the custom groupAction message now, (e.g. "connection.groupAction('lock', 'My custom message')")
With userAction, e.g. "userAction('kick', user.id, 'Custom message')", this would trigger a user message
with kind 'error'.

Using a custom message prefix, I could identify the action that triggered the custom 'error' message,
but maybe a 'kick' kind of message would be more appropriate? Could groupAction do something similar,
or did I overlook something?

Cheers,

Jeroen