From 121c3cb9c8bf63f9603fdba53e0a8f004de014b1 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 27 Nov 2012 13:27:41 -0500 Subject: [PATCH] zephyr_mirror: Fix display of personals on non-message classes. (imported from commit 42ff030d2d78c530428dcede406d46fc71521fef) --- bots/zephyr_mirror_backend.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 4e5b02f..280181d 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -288,8 +288,16 @@ def process_notice(notice, log): zeph["subject"] = '(instance "%s")' % (notice.instance,) # Add instances in for instanced personals - if zeph['type'] == "private" and notice.instance.lower() != "personal": - zeph["content"] = "[-i %s]" % (notice.instance,) + "\n" + zeph["content"] + if is_personal: + if notice.cls.lower() != "message" and notice.instance.lower != "personal": + heading = "[-c %s -i %s]\n" % (notice.cls, notice.instance) + elif notice.cls.lower() != "message": + heading = "[-c %s]\n" % (notice.cls,) + elif notice.instance.lower() != "personal": + heading = "[-i %s]\n" % (notice.instance,) + else: + heading = "" + zeph["content"] = heading + zeph["content"] zeph = decode_unicode_byte_strings(zeph)