Ignore duplicate messages
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
@ -208,7 +208,10 @@ class DataTLV(TLV):
|
||||
TODO: Check that the tuple (sender_id, nonce) is unique to avoid duplicates.
|
||||
"""
|
||||
msg = self.data.decode('UTF-8')
|
||||
squirrel.add_message(msg)
|
||||
if not squirrel.receive_message_from(msg, self.sender_id, self.nonce):
|
||||
# The message was already received
|
||||
return
|
||||
|
||||
nickname_match = re.match("(.*): (.*)", msg)
|
||||
if nickname_match is None:
|
||||
squirrel.send_packet(sender, Packet.construct(WarningTLV.construct(
|
||||
|
Reference in New Issue
Block a user