zephyr_mirror: Make outgoing zephyrs to ctl instead go to golem

This makes zulips to ctl@mit.edu cause the mirroring system to zephyr
golem@mit.edu.

(imported from commit 9059a92ba51fa87e45feae2f0d5549b36b048e8b)
This commit is contained in:
Zev Benjamin 2013-10-15 16:44:19 -04:00
parent 43764d415c
commit fab71363f4

View file

@ -91,6 +91,9 @@ def to_zulip_username(zephyr_username):
def to_zephyr_username(zulip_username):
(user, realm) = zulip_username.split("@")
if "|" not in user:
# Hack to make ctl's fake username setup work :)
if user.lower() == 'ctl':
user = 'golem'
return user.lower() + "@ATHENA.MIT.EDU"
match_user = re.match(r'([a-zA-Z0-9_]+)\|(.+)', user)
if not match_user: