Adding affiliation and room information#51
Conversation
* Adding affiliation to left and join output * Adding room.jid to log row for Occupant left * Adding room.jid to log row for New occupant Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se>
|
Thanks for the contribution @Philldomd Room jid in log lines make sense. I'm a little torn re the 'affiliation' user context since it's very specific to token_affiliation, and adding this as a default behaviour increases payload size for everyone. We made an exception for id/name/email since those are documented and would likely be set for most jwt users. I'm tempted to suggest that we add the new entry commented out to serve as an example, with some additional comment stating "additional fields from jwt user context can be included in the payload e.g. the 'affiliation' field as required by token_affiliation module". Thoughts @emrahcom ? |
|
In my opinion, it would be nice to have the option to add additional context. Commented entry as an example is fine for VM setup but it doesn't help in Docker setup. By the way I don't think that the payload size is very critical since it still contains small data.
|
Good point.
A config option to enable that would be nice. Which I'm assuming is easy to set when enabling event_sync in a Docker setup. e.g. This is slightly more work that just optionally including "affiliation", but perhaps more useful to a wider audience? |
|
@Philldomd Any chance you're willing to take this on? General idea - Add a module option I'd offer to help, but alas I don't work with Jitsi much these days and no longer have a deployment ready at hand to test changes. |
|
Hmm sure I could give it a try. I have a jitsi setup. I will reach out if I'm in need of assistance understanding something. Is there an example of plug-in variables in some other files? |
|
Thanks for taking this on 🙂 Perhaps take a look at how |
Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se>
|
Hi Check if the new addition suits our need better. If include_user_info is set the whole user context is looped over and added to output. |
Signed-off-by: Örnfeldt Philip (66140321) <philip.ornfeldt@forsakringskassan.se>
fae82a1 to
739d725
Compare
|
I haven't tried it but wouldn't this work instead of looping? |
That could work assuming If that works, then my comments above should be ignored and we can set occupant_jid, joined_at, left_at later. |
|
I was uncertain lua would handle the conversion if any. But I could try data = context . Would it handle if user_context contains another map when using = here? |
Would lua create a hard copy? |
|
That was indeed my concern. My main concern would be whether that data is still accessible when the user session is gone but we still need that information for the muc-room-destroyed event. Would be interesting to find out if you have a deployment you can test this in. |
|
My concern was the addition of fields that might interfere in other parts. |
|
Excellent point. We definitely shouldn't modify existing user_context. I'm assuming you've test this all locally and the payload is as expected with and without that new option? |
|
I can do the smal changes you suggested and run it one more time tomorrow, with and without include_user_info |
|
Thank you Philip. Appreciate your effort on this. |
include_user_info: false
2026-02-27 10:05:03 muc.meet.jitsi:event_sync_component info New occupant in room: fk_test@muc.meet.jitsi -
{
"occupant_jid":"f8268548-80b8-4d9c-90c6-9d34e0f921a4@meet.jitsi/91COYvL_UzNG",
"joined_at":1772183103,
"name":"Philip"
}
2026-02-27 10:05:04 muc.meet.jitsi:event_sync_component info Occupant left in room: fk_test@muc.meet.jitsi -
{
"occupant_jid":"f8268548-80b8-4d9c-90c6-9d34e0f921a4@meet.jitsi/91COYvL_UzNG",
"joined_at":1772183103,
"name":"Philip",
"left_at":1772183104
}
include_user_info: true
2026-02-27 10:07:41 muc.meet.jitsi:event_sync_component info New occupant in room: fk_test@muc.meet.jitsi -
{
"occupant_jid":"b5ad11b3-13d7-43c8-90a3-dfa6f53304b1@meet.jitsi/gd3WNZ_zFPs-",
"joined_at":1772183261,
"lobby_bypass":true,
"name":"Philip",
"affiliation":"owner"
}
2026-02-27 10:07:43 muc.meet.jitsi:event_sync_component info Occupant left in room: fk_test@muc.meet.jitsi -
{
"occupant_jid":"b5ad11b3-13d7-43c8-90a3-dfa6f53304b1@meet.jitsi/gd3WNZ_zFPs-",
"left_at":1772183263,
"joined_at":1772183261,
"lobby_bypass":true,
"name":"Philip",
"affiliation":"owner"
}
Tested and commited with changes |
When using this combined with token_affiliation we would like to get that information by event_sync as well.
When occupants join or leave the log should tell us which room, in larger systems its really hard to connect log rows against specific meetings.