Add deduplication precision toggle, fix printing odd characters and implement sending messages to all instances of a certain network, or all networks associated with a certain alias

This commit is contained in:
2019-08-16 21:27:23 +01:00
parent 22bd0d3ac6
commit 545282e201
5 changed files with 55 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ from utils.logging.debug import debug
def dedup(numName, c):
# deduplication
c["approxtime"] = int(datetime.utcnow().timestamp())
c["approxtime"] = str(datetime.utcnow().timestamp())[:main.config["Tweaks"]["DedupPrecision"]]
castHash = siphash24(main.hashKey, dumps(c, sort_keys=True).encode("utf-8"))
del c["approxtime"]
isDuplicate= any(castHash in main.lastEvents[x] for x in main.lastEvents.keys() if not x == numName)