Skip to content

Commit 098be79

Browse files
committed
Pass everything from conference
Signed-off-by: Šimon Brandner <[email protected]>
1 parent 450d195 commit 098be79

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

pkg/conference/matrix_message_processor.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,25 @@ func (c *Conference) onNewParticipant(participantID ParticipantID, inviteEvent *
5252
} else {
5353
messageSink := common.NewMessageSink(participantID, c.peerMessages)
5454

55-
keepAliveDeadline := time.Duration(c.config.KeepAliveTimeout) * time.Second
5655
pingInterval := time.Duration(c.config.PingInterval) * time.Second
56+
keepAliveDeadline := time.Duration(c.config.KeepAliveTimeout) * time.Second
5757
sendPing := func() {
5858
participant.sendDataChannelMessage(event.Event{
5959
Type: event.FocusCallPing,
6060
Content: event.Content{},
6161
})
6262
}
63+
onDeadLine := func() {
64+
messageSink.Send(peer.LeftTheCall{Reason: event.CallHangupKeepAliveTimeout})
65+
}
6366
peer, answer, err := peer.NewPeer(
6467
inviteEvent.Offer.SDP,
6568
messageSink,
6669
logger,
6770
pingInterval,
6871
keepAliveDeadline,
6972
sendPing,
73+
onDeadLine,
7074
)
7175
if err != nil {
7276
logger.WithError(err).Errorf("Failed to process SDP offer")

pkg/peer/peer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type Peer[ID comparable] struct {
3636

3737
pong chan Pong
3838
sendPing func()
39+
onDeadLine func()
3940
pingInterval time.Duration
4041
keepAliveDeadline time.Duration
4142

@@ -51,6 +52,7 @@ func NewPeer[ID comparable](
5152
pingInterval time.Duration,
5253
keepAliveDeadline time.Duration,
5354
sendPing func(),
55+
onDeadLine func(),
5456
) (*Peer[ID], *webrtc.SessionDescription, error) {
5557
peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{})
5658
if err != nil {
@@ -67,6 +69,7 @@ func NewPeer[ID comparable](
6769
pingInterval: pingInterval,
6870
keepAliveDeadline: keepAliveDeadline,
6971
sendPing: sendPing,
72+
onDeadLine: onDeadLine,
7073
}
7174

7275
peerConnection.OnTrack(peer.onRtpTrackReceived)

pkg/peer/webrtc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (p *Peer[ID]) onDataChannelReady(dc *webrtc.DataChannel) {
139139
p.keepAliveDeadline,
140140
p.pong,
141141
p.sendPing,
142-
func() { p.sink.Send(LeftTheCall{event.CallHangupKeepAliveTimeout}) },
142+
p.onDeadLine,
143143
)
144144
})
145145

0 commit comments

Comments
 (0)