Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
* [Galene] groupAction clearchat & lock
@ 2021-07-30 14:42 Jeroen van Veen
  2021-07-30 15:00 ` [Galene] " Jeroen van Veen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jeroen van Veen @ 2021-07-30 14:42 UTC (permalink / raw)
  To: galene

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2328 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 14:42 [Galene] groupAction clearchat & lock Jeroen van Veen
@ 2021-07-30 15:00 ` Jeroen van Veen
  2021-07-30 15:13   ` Jeroen van Veen
  2021-07-30 17:28 ` Juliusz Chroboczek
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Jeroen van Veen @ 2021-07-30 15:00 UTC (permalink / raw)
  To: galene

[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2988 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 15:00 ` [Galene] " Jeroen van Veen
@ 2021-07-30 15:13   ` Jeroen van Veen
  2021-07-30 17:40     ` Juliusz Chroboczek
  0 siblings, 1 reply; 10+ messages in thread
From: Jeroen van Veen @ 2021-07-30 15:13 UTC (permalink / raw)
  To: galene

[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]

One more small thing, shouldn't app.connection.userMessage('kick', user.id, text, false) echo
the user message? It only seems to be echoed without targetting a specific user.

-- Jeroen

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

> 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

[-- Attachment #2: Type: text/html, Size: 3815 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 14:42 [Galene] groupAction clearchat & lock Jeroen van Veen
  2021-07-30 15:00 ` [Galene] " Jeroen van Veen
@ 2021-07-30 17:28 ` Juliusz Chroboczek
  2021-07-30 17:34 ` Juliusz Chroboczek
  2021-07-30 17:39 ` Juliusz Chroboczek
  3 siblings, 0 replies; 10+ messages in thread
From: Juliusz Chroboczek @ 2021-07-30 17:28 UTC (permalink / raw)
  To: Jeroen van Veen; +Cc: galene

> For record/unrecord, I would check the onUser event for a user with name
> RECORDING.

That's not safe, there could be a user that chose the name RECORDING.

I've just added a new permission called "system".  Only the RECORDING user
has it right now, and the server guarantees that no ordinary user will
ever have it.

-- Juliusz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 14:42 [Galene] groupAction clearchat & lock Jeroen van Veen
  2021-07-30 15:00 ` [Galene] " Jeroen van Veen
  2021-07-30 17:28 ` Juliusz Chroboczek
@ 2021-07-30 17:34 ` Juliusz Chroboczek
  2021-07-30 17:45   ` Juliusz Chroboczek
  2021-07-30 17:39 ` Juliusz Chroboczek
  3 siblings, 1 reply; 10+ messages in thread
From: Juliusz Chroboczek @ 2021-07-30 17:34 UTC (permalink / raw)
  To: Jeroen van Veen; +Cc: galene

> 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')")

Are you not receiving a message of type "joined", kind "change" when the
group becomes locked?  The information you look for should be in the
"status" field.

As to the custom message, perhaps the status field should look like this:

  status: {
      locked: "custom message"
  }

This would still allow testing as a Boolean, except in the case where the
message is empty (damn Javascript).

-- Juliusz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 14:42 [Galene] groupAction clearchat & lock Jeroen van Veen
                   ` (2 preceding siblings ...)
  2021-07-30 17:34 ` Juliusz Chroboczek
@ 2021-07-30 17:39 ` Juliusz Chroboczek
  2021-08-02 18:52   ` Jeroen van Veen
  3 siblings, 1 reply; 10+ messages in thread
From: Juliusz Chroboczek @ 2021-07-30 17:39 UTC (permalink / raw)
  To: Jeroen van Veen; +Cc: galene

> 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?

Agreed.  I've just changed the protocol so it sends kind="kicked" instead
of "error" before kicking out a user.

-- Juliusz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 15:13   ` Jeroen van Veen
@ 2021-07-30 17:40     ` Juliusz Chroboczek
  0 siblings, 0 replies; 10+ messages in thread
From: Juliusz Chroboczek @ 2021-07-30 17:40 UTC (permalink / raw)
  To: Jeroen van Veen; +Cc: galene

> One more small thing, shouldn't app.connection.userMessage('kick',
> user.id, text, false) echo the user message? It only seems to be echoed
> without targetting a specific user.

I cannot reproduce the issue, I reliably get the message.

-- Juliusz


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 17:34 ` Juliusz Chroboczek
@ 2021-07-30 17:45   ` Juliusz Chroboczek
  2021-08-02 18:54     ` Jeroen van Veen
  0 siblings, 1 reply; 10+ messages in thread
From: Juliusz Chroboczek @ 2021-07-30 17:45 UTC (permalink / raw)
  To: Jeroen van Veen; +Cc: galene

> As to the custom message, perhaps the status field should look like this:
> 
>   status: {
>       locked: "custom message"
>   }

Done.  You will now get either true or a non-empty string in the "locked"
field.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 17:39 ` Juliusz Chroboczek
@ 2021-08-02 18:52   ` Jeroen van Veen
  0 siblings, 0 replies; 10+ messages in thread
From: Jeroen van Veen @ 2021-08-02 18:52 UTC (permalink / raw)
  To: Juliusz Chroboczek; +Cc: galene

Thanks for the quick response Juliusz, I'll update the client code accordingly.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Op vrijdag 30 juli 2021 om 7:39 PM schreef Juliusz Chroboczek <jch@irif.fr>:

> > 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?
>
> Agreed. I've just changed the protocol so it sends kind="kicked" instead
>
> of "error" before kicking out a user.
>
> -- Juliusz
>
> Galene mailing list -- galene@lists.galene.org
>
> To unsubscribe send an email to galene-leave@lists.galene.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Galene] Re: groupAction clearchat & lock
  2021-07-30 17:45   ` Juliusz Chroboczek
@ 2021-08-02 18:54     ` Jeroen van Veen
  0 siblings, 0 replies; 10+ messages in thread
From: Jeroen van Veen @ 2021-08-02 18:54 UTC (permalink / raw)
  To: Juliusz Chroboczek; +Cc: galene

Great! I'll update Pyrite later this week.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Op vrijdag 30 juli 2021 om 7:45 PM schreef Juliusz Chroboczek <jch@irif.fr>:

> > As to the custom message, perhaps the status field should look like this:
>
> > status: {
> >
> > locked: "custom message"
> >
> > }
>
> Done. You will now get either true or a non-empty string in the "locked"
>
> field.
>
> Galene mailing list -- galene@lists.galene.org
>
> To unsubscribe send an email to galene-leave@lists.galene.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-02 18:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 14:42 [Galene] groupAction clearchat & lock Jeroen van Veen
2021-07-30 15:00 ` [Galene] " Jeroen van Veen
2021-07-30 15:13   ` Jeroen van Veen
2021-07-30 17:40     ` Juliusz Chroboczek
2021-07-30 17:28 ` Juliusz Chroboczek
2021-07-30 17:34 ` Juliusz Chroboczek
2021-07-30 17:45   ` Juliusz Chroboczek
2021-08-02 18:54     ` Jeroen van Veen
2021-07-30 17:39 ` Juliusz Chroboczek
2021-08-02 18:52   ` Jeroen van Veen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox