From 3b817ecc1c19aa2cf519ab52f4f1e2758d1d6cfe Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 24 Sep 2012 17:38:21 -0400 Subject: [PATCH] Actually fix deduplication of synced huddle messages. (imported from commit 63e7fbdc89e1271751f73d20f2185a048b56dd60) --- zephyr/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zephyr/views.py b/zephyr/views.py index 515b1fd991..4683aa0f5c 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -190,9 +190,10 @@ def forge_zephyr(request): if (request.POST['type'] == 'personal' and ',' in request.POST['recipient']): # Huddle message, need to make sure we're not syncing it twice! - if Zephyr.objects.filter(sender__user__email=request.POST['sender'], - content=request.POST['new_zephyr'], - pub_date=datetime.datetime.utcfromtimestamp(float(request.POST['time'])).replace(tzinfo=utc)): + if Zephyr.objects.filter(sender__user__email=email, + content=md_engine.convert(request.POST['new_zephyr']), + pub_date__gt=datetime.datetime.utcfromtimestamp(float(request.POST['time']) - 1).replace(tzinfo=utc), + pub_date__lt=datetime.datetime.utcfromtimestamp(float(request.POST['time']) + 1).replace(tzinfo=utc)): # This is a duplicate huddle message, deduplicate! return json_success()