mirror of https://github.com/zulip/zulip.git
Use zero-width characters for message loop checking.
(imported from commit 61f6dca96cd1d8431258afc0181e71d5b709e300)
This commit is contained in:
parent
0a4366ea6b
commit
06ee153faa
|
@ -115,8 +115,9 @@ def process_loop(log):
|
||||||
zsig, body = notice.message.split("\x00", 1)
|
zsig, body = notice.message.split("\x00", 1)
|
||||||
is_personal = False
|
is_personal = False
|
||||||
is_huddle = False
|
is_huddle = False
|
||||||
|
if isinstance(zsig, str):
|
||||||
if zsig.endswith("`") and zsig.startswith("`"):
|
# Check for width unicode character u'\u200B'.encode("utf-8")
|
||||||
|
if u'\u200B'.encode("utf-8") in zsig:
|
||||||
print "Skipping message from Humbug!"
|
print "Skipping message from Humbug!"
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -217,7 +218,7 @@ def get_new_zephyrs():
|
||||||
return simplejson.loads(res.read())['zephyrs']
|
return simplejson.loads(res.read())['zephyrs']
|
||||||
|
|
||||||
def send_zephyr(message):
|
def send_zephyr(message):
|
||||||
zsig = "`%s`" % (username_to_fullname(message["sender_email"]))
|
zsig = u"%s\u200B" % (username_to_fullname(message["sender_email"]))
|
||||||
if ' dot ' in zsig:
|
if ' dot ' in zsig:
|
||||||
print "ERROR! Couldn't compute zsig for %s!" % (message["sender_email"])
|
print "ERROR! Couldn't compute zsig for %s!" % (message["sender_email"])
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue