From b6f45664b7e3c6a124f7937c50d0b471550177c3 Mon Sep 17 00:00:00 2001 From: braginini Date: Mon, 19 Apr 2021 14:25:14 +0200 Subject: [PATCH] chore: add a single message to signal server --- signal/signal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/signal/signal.go b/signal/signal.go index f6a2b7ccc..aa421298c 100644 --- a/signal/signal.go +++ b/signal/signal.go @@ -31,8 +31,8 @@ func NewServer() *SignalExchangeServer { func (s *SignalExchangeServer) Connect(ctx context.Context, msg *proto.Message) (*proto.Message, error) { - if _, found := s.registry.Peers[msg.Key]; found { - return &proto.Message{}, nil + if _, found := s.registry.Peers[msg.Key]; !found { + return nil, fmt.Errorf("unknown peer %s", msg.Key) } if dstPeer, found := s.registry.Peers[msg.RemoteKey]; found {