add early message forward

This commit is contained in:
Pascal Fischer 2024-08-09 14:59:55 +02:00
parent d98df551c0
commit 5a37be01c3

View File

@ -76,10 +76,10 @@ func (s *Server) Send(ctx context.Context, msg *proto.EncryptedMessage) (*proto.
return &proto.EncryptedMessage{}, nil
}
// if _, found := s.registry.Get(msg.RemoteKey); found {
// s.forwardMessageToPeer(ctx, msg)
// return &proto.EncryptedMessage{}, nil
// }
if _, found := s.registry.Get(msg.RemoteKey); found {
s.forwardMessageToPeer(ctx, msg)
return &proto.EncryptedMessage{}, nil
}
return s.dispatcher.SendMessage(context.Background(), msg)
}