zephyr_mirror: Rename humbug_username to to_humbug_username.
(imported from commit 764673b9ccf2f58f88e1d6eec173a1c49ac15cad)
This commit is contained in:
parent
53f75affe7
commit
fb4e45e644
|
@ -78,7 +78,7 @@ humbug_client = api.common.HumbugAPI(email=options.user + "@mit.edu",
|
||||||
|
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
||||||
def humbug_username(zephyr_username):
|
def to_humbug_username(zephyr_username):
|
||||||
return zephyr_username.lower().split("@")[0] + "@mit.edu"
|
return zephyr_username.lower().split("@")[0] + "@mit.edu"
|
||||||
|
|
||||||
def unwrap_lines(body):
|
def unwrap_lines(body):
|
||||||
|
@ -89,7 +89,7 @@ def unwrap_lines(body):
|
||||||
def send_humbug(zeph):
|
def send_humbug(zeph):
|
||||||
if options.forward_class_messages:
|
if options.forward_class_messages:
|
||||||
zeph["forged"] = "yes"
|
zeph["forged"] = "yes"
|
||||||
zeph["sender"] = humbug_username(zeph["sender"])
|
zeph["sender"] = to_humbug_username(zeph["sender"])
|
||||||
zeph['fullname'] = username_to_fullname(zeph['sender'])
|
zeph['fullname'] = username_to_fullname(zeph['sender'])
|
||||||
zeph['shortname'] = zeph['sender'].split('@')[0]
|
zeph['shortname'] = zeph['sender'].split('@')[0]
|
||||||
if "subject" in zeph:
|
if "subject" in zeph:
|
||||||
|
@ -234,7 +234,7 @@ def process_notice(notice, log):
|
||||||
if body.startswith("CC:"):
|
if body.startswith("CC:"):
|
||||||
is_huddle = True
|
is_huddle = True
|
||||||
# Map "CC: sipbtest espuser" => "starnine@mit.edu,espuser@mit.edu"
|
# Map "CC: sipbtest espuser" => "starnine@mit.edu,espuser@mit.edu"
|
||||||
huddle_recipients_list = [humbug_username(x.strip()) for x in
|
huddle_recipients_list = [to_humbug_username(x.strip()) for x in
|
||||||
body.split("\n")[0][4:].split()]
|
body.split("\n")[0][4:].split()]
|
||||||
if sender not in huddle_recipients_list:
|
if sender not in huddle_recipients_list:
|
||||||
huddle_recipients_list.append(sender)
|
huddle_recipients_list.append(sender)
|
||||||
|
@ -260,7 +260,7 @@ def process_notice(notice, log):
|
||||||
zeph = { 'type' : 'personal',
|
zeph = { 'type' : 'personal',
|
||||||
'time' : str(notice.time),
|
'time' : str(notice.time),
|
||||||
'sender' : sender,
|
'sender' : sender,
|
||||||
'recipient' : humbug_username(recipient),
|
'recipient' : to_humbug_username(recipient),
|
||||||
'zsig' : zsig, # logged here but not used by app
|
'zsig' : zsig, # logged here but not used by app
|
||||||
'content' : body }
|
'content' : body }
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue