From 18b87a0ede2fa378746caa4cc0dd267b8e9f445c Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 3 Oct 2012 13:47:54 -0400 Subject: [PATCH] zephyr_mirror: Fix bug computing recipients when sending huddles. (imported from commit c6a7eadfa9cd007945d423e4e93f088857897e26) --- zephyr_mirror.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zephyr_mirror.py b/zephyr_mirror.py index c7d3063..763625d 100644 --- a/zephyr_mirror.py +++ b/zephyr_mirror.py @@ -93,8 +93,6 @@ def compute_humbug_username(zephyr_username): def send_humbug(zeph): zeph["sender"] = compute_humbug_username(zeph["sender"]) - if "recipient" in zeph: - zeph["recipient"] = compute_humbug_username(zeph["recipient"]) zeph['fullname'] = username_to_fullname(zeph['sender']) zeph['shortname'] = zeph['sender'].split('@')[0] if "instance" in zeph: @@ -176,7 +174,7 @@ def process_loop(log): if body.startswith("CC:"): is_huddle = True # Map "CC: sipbtest espuser" => "starnine@mit.edu,espuser@mit.edu" - huddle_recipients_list = [x + "@mit.edu" for x in + huddle_recipients_list = [compute_humbug_username(x.strip()) for x in body.split("\n")[0][4:].split()] if sender not in huddle_recipients_list: huddle_recipients_list.append(sender) @@ -203,7 +201,7 @@ def process_loop(log): zeph = { 'type' : 'personal', 'time' : str(notice.time), 'sender' : sender, - 'recipient' : recipient, + 'recipient' : compute_humbug_username(recipient), 'zsig' : zsig, # logged here but not used by app 'content' : body } else: