diff --git a/src/eddn/Relay.py b/src/eddn/Relay.py index 8741f4f..0d3bbd0 100644 --- a/src/eddn/Relay.py +++ b/src/eddn/Relay.py @@ -127,13 +127,6 @@ class Relay(Thread): if 'uploaderIP' in json['header']: del json['header']['uploaderIP'] - # Remove personal data from FSDJump and Location => MyReputation - if '/journal/' in json['$schemaRef'] and 'event' in json['message']: - if json['message']['event'] in ['FSDJump', 'Location'] and 'Factions' in json['message']: - for i, values in enumerate(json['message']['Factions']): - if 'MyReputation' in values: - del json['message']['Factions'][i]['MyReputation'] - # Convert message back to JSON message = simplejson.dumps(json, sort_keys=True) diff --git a/src/eddn/core/DuplicateMessages.py b/src/eddn/core/DuplicateMessages.py index 76ff72e..b32844d 100644 --- a/src/eddn/core/DuplicateMessages.py +++ b/src/eddn/core/DuplicateMessages.py @@ -42,23 +42,20 @@ class DuplicateMessages(Thread): 'message': dict(json['message']), } - # Convert starPos to avoid software modification in dupe messages + # Remove timestamp (Mainly to avoid multiple scan messages and faction influences) + jsonTest['message'].pop('timestamp') + + # Convert journal starPos to avoid software modification in dupe messages if 'StarPos' in jsonTest['message']: jsonTest['message']['StarPos'] = [int(round(x * 32)) for x in jsonTest['message']['StarPos']] - # Prevent Docked event with small difference in distance from start + # Prevent journal Docked event with small difference in distance from start if 'DistFromStarLS' in jsonTest['message']: jsonTest['message']['DistFromStarLS'] = int(jsonTest['message']['DistFromStarLS'] + 0.5) - # Remove journal timestamp (Mainly to avoid multiple scan messages and faction influences) - if 'timestamp' in jsonTest['message']: - del jsonTest['message']['timestamp'] - # Remove journal ScanType and DistanceFromArrivalLS (Avoid duplicate scan messages after SAAScanComplete) - if 'ScanType' in jsonTest['message']: - del jsonTest['message']['ScanType'] - if 'DistanceFromArrivalLS' in jsonTest['message']: - del jsonTest['message']['DistanceFromArrivalLS'] + jsonTest['message'].pop('ScanType', None) + jsonTest['message'].pop('DistanceFromArrivalLS', None) message = simplejson.dumps(jsonTest, sort_keys=True) # Ensure most duplicate messages will get the same key key = hashlib.sha256(message).hexdigest()