Do not send ParticipantJoined webhook if connection was resumed (#1795)

* Do not send ParticipantJoined webhook if connection was resumed

* isResume -> isMigration
This commit is contained in:
David Zhao
2023-06-15 15:39:04 -07:00
committed by GitHub
parent 0dab55556d
commit f71544e27a
5 changed files with 32 additions and 22 deletions
+9 -4
View File
@@ -280,10 +280,15 @@ func (r *Room) Join(participant types.LocalParticipant, requestSource routing.Me
// start the workers once connectivity is established
p.Start()
r.telemetry.ParticipantActive(context.Background(), r.ToProto(), p.ToProto(), &livekit.AnalyticsClientMeta{
ClientConnectTime: uint32(time.Since(p.ConnectedAt()).Milliseconds()),
ConnectionType: string(p.GetICEConnectionType()),
})
r.telemetry.ParticipantActive(context.Background(),
r.ToProto(),
p.ToProto(),
&livekit.AnalyticsClientMeta{
ClientConnectTime: uint32(time.Since(p.ConnectedAt()).Milliseconds()),
ConnectionType: string(p.GetICEConnectionType()),
},
false,
)
} else if state == livekit.ParticipantInfo_DISCONNECTED {
// remove participant from room
go r.RemoveParticipant(p.Identity(), p.ID(), types.ParticipantCloseReasonStateDisconnected)