diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index ce73e4b..3da5eb9 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -391,7 +391,16 @@ def forward_to_zephyr(message): p.communicate(input=wrapped_content) def maybe_forward_to_zephyr(message): - if message["sender_email"] == options.user + "@mit.edu": + if (message["sender_email"] == options.user + "@mit.edu"): + if not ((message["type"] == "stream") or + (message["type"] == "personal" and + message["display_recipient"]["email"].lower().endswith("mit.edu")) or + (message["type"] == "huddle" and + False not in [u["email"].lower().endswith("mit.edu") for u in + message["display_recipient"]])): + # Don't try forward personals/huddles with non-MIT users + # to MIT Zephyr. + return timestamp_now = datetime.datetime.now().strftime("%s") if float(message["timestamp"]) < float(timestamp_now) - 15: print "%s humbug=>zephyr: Alert! Out of order message: %s < %s" % \