zephyr_mirror: Fix handling of Humbug=>Zephyr personals.
(imported from commit 149f8aaf9076583499392bcb09a0250b05c3dea6)
This commit is contained in:
parent
94a553f0f1
commit
bb80b86e25
|
@ -462,9 +462,16 @@ def forward_to_zephyr(message):
|
|||
zephyr_class = "message"
|
||||
zwrite_args.extend(["-c", zephyr_class, "-i", instance])
|
||||
elif message['type'] == "private":
|
||||
if len(message['display_recipient']) <= 2:
|
||||
if len(message['display_recipient']) == 1:
|
||||
recipient = to_zephyr_username(message["display_recipient"][0]["email"])
|
||||
zwrite_args.extend([recipient])
|
||||
elif len(message['display_recipient']) == 2:
|
||||
recipient = ""
|
||||
for r in message["display_recipient"]:
|
||||
if r["email"].lower() != humbug_account_email.lower():
|
||||
recipient = to_zephyr_username(r["email"])
|
||||
break
|
||||
zwrite_args.extend([recipient])
|
||||
else:
|
||||
zwrite_args.extend(["-C"])
|
||||
zwrite_args.extend([to_zephyr_username(user["email"]).replace("@ATHENA.MIT.EDU", "")
|
||||
|
|
Loading…
Reference in a new issue