Exemple #1
0
    def broadcast_ephemeral_message(self, encrypted_ephemeral: EncryptedEphemeralMessage) -> bool:
        if not encrypted_ephemeral.validate():
            return False

        self._p2pfactory.broadcast_ephemeral_message(encrypted_ephemeral)

        return True
Exemple #2
0
    def handle_ephemeral(self, source, message: qrllegacy_pb2.LegacyMessage):
        """
        Receives Ephemeral Message
        :param source:
        :param message:
        :return:
        """
        try:
            encrypted_ephemeral = EncryptedEphemeralMessage(message.ephData)
        except Exception as e:
            logger.error(
                'ephemeral_message rejected - unable to decode serialised data - closing connection'
            )
            logger.exception(e)
            source.loseConnection()
            return

        if not source.factory.master_mr.isRequested(
                encrypted_ephemeral.get_message_hash(), self):
            return

        if not encrypted_ephemeral.validate():
            return

        source.factory.broadcast_ephemeral_message(
            encrypted_ephemeral)  # FIXME(cyyber) : Fix broken link
Exemple #3
0
    def broadcast_ephemeral_message(self, encrypted_ephemeral: EncryptedEphemeralMessage) -> bool:
        if not encrypted_ephemeral.validate():
            return False

        self._p2pfactory.broadcast_ephemeral_message(encrypted_ephemeral)

        return True