From 8a066bb340ffaa0727316244fc0fc440e33fe451 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 21 Dec 2020 16:04:09 +0100 Subject: [PATCH] Handle warnings (receive only) Signed-off-by: Yohann D'ANELLO --- squinnondation/squinnondation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/squinnondation/squinnondation.py b/squinnondation/squinnondation.py index 866176a..9600d9c 100644 --- a/squinnondation/squinnondation.py +++ b/squinnondation/squinnondation.py @@ -398,6 +398,9 @@ class WarningTLV(TLV): self.length.to_bytes(1, "big") + \ self.message.encode("UTF-8")[:self.length] + def handle(self, squirrel: "Squirrel", sender: "Hazelnut") -> None: + squirrel.add_message(f" *A client warned you: {self.message}*") + class Packet: """