From cd5b623cfd6140695f7fda3e369de6703679401e Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Fri, 31 Aug 2012 16:50:24 -0400 Subject: [PATCH] Reply to the recipient instead of the sender if replying to my own personal Previously, if hamlet wrote to iago, and then hit "r" on his own message, the form would prompt hamlet to reply to himself. Now, Humbug will DTRT and prefill the form with iago instead. (imported from commit cb3260d1d0bc89b184dac84ebf1e5642d0bc1606) --- templates/zephyr/index.html | 1 + zephyr/static/js/zephyr.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/zephyr/index.html b/templates/zephyr/index.html index d8e56ba9dc..4326c97c4a 100644 --- a/templates/zephyr/index.html +++ b/templates/zephyr/index.html @@ -11,6 +11,7 @@
diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index a4a022c300..2467699d0c 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -146,7 +146,12 @@ $(document).keydown(function(event) { $("#new_zephyr").focus(); $("#new_zephyr").select(); } else { // No instance, must be a personal - prepare_personal(parent.find("span.zephyr_sender").text()); + + var recipient = parent.find("span.zephyr_sender").text(); + if (recipient == username) { // that is, we sent the original message + recipient = parent.find("span.zephyr_personal_recipient").text(); + } + prepare_personal(recipient); $("#new_personal_zephyr").focus(); $("#new_personal_zephyr").select(); }