From c3c3045e3dda3942a1e96b4b94b43873f19ce237 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 8 Nov 2012 13:57:21 -0500 Subject: [PATCH] zephyr_mirror: Forward messages sent to the empty instance more clearly. (imported from commit 1fb5e4f8ce9941b3ca89688821d325d7ae49aee5) --- bots/zephyr_mirror.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 3dbb8ba..14753da 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -266,7 +266,7 @@ def process_notice(notice, log): if notice.instance != "": zeph['subject'] = notice.instance else: - zeph["subject"] = "personal" + zeph["subject"] = "(no instance)" # Add instances in for instanced personals if zeph['type'] == "personal" and notice.instance.lower() != "personal": @@ -367,6 +367,10 @@ def forward_to_zephyr(message): if message['type'] == "stream": zephyr_class = message["display_recipient"] instance = message["subject"] + if instance == "(no instance)": + # Forward messages sent to "(no instance)" back to the + # empty instance for bidirectional mirroring + instance = "" if (instance == "instance %s" % (zephyr_class,) or instance == "test instance %s" % (zephyr_class,)): # Forward messages to e.g. -c -i white-magic back from the