Skip to content

Commit 12c5487

Browse files
authored
Add display property on leave or unpublish event (#3426)
1 parent 3afddf0 commit 12c5487

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/plugins/janus_videoroom.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,8 @@ room-<unique room ID>: {
10131013
{
10141014
"videoroom" : "event",
10151015
"room" : <room ID>,
1016-
"leaving : <unique ID of the participant who left>
1016+
"leaving : <unique ID of the participant who left>,
1017+
"display" : "<display name of the leaving participant, if any>"
10171018
}
10181019
\endverbatim
10191020
*
@@ -4410,6 +4411,8 @@ static void janus_videoroom_leave_or_unpublish(janus_videoroom_publisher *partic
44104411
json_t *event = json_object();
44114412
json_object_set_new(event, "videoroom", json_string("event"));
44124413
json_object_set_new(event, "room", string_ids ? json_string(participant->room_id_str) : json_integer(participant->room_id));
4414+
if(participant->display)
4415+
json_object_set_new(event, "display", json_string(participant->display));
44134416
json_object_set_new(event, is_leaving ? (kicked ? "kicked" : "leaving") : "unpublished",
44144417
string_ids ? json_string(participant->user_id_str) : json_integer(participant->user_id));
44154418
janus_videoroom_notify_participants(participant, event, FALSE);
@@ -4419,6 +4422,8 @@ static void janus_videoroom_leave_or_unpublish(janus_videoroom_publisher *partic
44194422
json_object_set_new(info, "event", json_string(is_leaving ? (kicked ? "kicked" : "leaving") : "unpublished"));
44204423
json_object_set_new(info, "room", string_ids ? json_string(participant->room_id_str) : json_integer(participant->room_id));
44214424
json_object_set_new(info, "id", string_ids ? json_string(participant->user_id_str) : json_integer(participant->user_id));
4425+
if(participant->display)
4426+
json_object_set_new(info, "display", json_string(participant->display));
44224427
gateway->notify_event(&janus_videoroom_plugin, NULL, info);
44234428
}
44244429
if(is_leaving) {

0 commit comments

Comments
 (0)