mirror of https://github.com/dani/vroom.git
Minor comment
This commit is contained in:
parent
eaac817594
commit
1065b747fe
5
vroom
5
vroom
|
@ -1296,8 +1296,7 @@ websocket '/socket.io/:ver/websocket/:id' => sub {
|
||||||
my $key = $self->session('key');
|
my $key = $self->session('key');
|
||||||
|
|
||||||
# Add the peer on redis
|
# Add the peer on redis
|
||||||
$self->add_peer($id,
|
$self->add_peer($id, {
|
||||||
{
|
|
||||||
last => time,
|
last => time,
|
||||||
id => $self->session('id'),
|
id => $self->session('id'),
|
||||||
check_invitations => 1
|
check_invitations => 1
|
||||||
|
@ -1306,6 +1305,8 @@ websocket '/socket.io/:ver/websocket/:id' => sub {
|
||||||
|
|
||||||
$self->redis->subscribe(['signaling:peer:' . $id]);
|
$self->redis->subscribe(['signaling:peer:' . $id]);
|
||||||
|
|
||||||
|
# This callback will send the message to the peer through
|
||||||
|
# websocket when received on the personnal channel
|
||||||
$cb = $self->redis->on(message => sub {
|
$cb = $self->redis->on(message => sub {
|
||||||
my ($redis, $message, $channel) = @_;
|
my ($redis, $message, $channel) = @_;
|
||||||
$self->tx->send(Protocol::SocketIO::Message->new->parse(Mojo::JSON::from_json($message)))
|
$self->tx->send(Protocol::SocketIO::Message->new->parse(Mojo::JSON::from_json($message)))
|
||||||
|
|
Loading…
Reference in New Issue