zephyr_mirror: Parse zsig/body in its own function.

(imported from commit b692fa692d24d79f797852acffa0472d68930c88)
This commit is contained in:
Tim Abbott 2012-11-02 17:16:19 -04:00
parent cf92525270
commit b69201455c

View file

@ -210,12 +210,15 @@ def process_loop(log):
# Ask the Humbug server about any new classes to subscribe to # Ask the Humbug server about any new classes to subscribe to
update_subscriptions_from_humbug() update_subscriptions_from_humbug()
def process_notice(notice, log): def parse_zephyr_body(zephyr_data):
try: try:
zsig, body = notice.message.split("\x00", 1) (zsig, body) = zephyr_data.split("\x00", 1)
except ValueError: except ValueError:
body = notice.message (zsig, body) = ("", zephyr_data)
zsig = "" return (zsig, body)
def process_notice(notice, log):
(zsig, body) = parse_zephyr_body(notice.message)
is_personal = False is_personal = False
is_huddle = False is_huddle = False