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)
This commit is contained in:
Luke Faraone 2012-08-31 16:50:24 -04:00
parent 29a41d992e
commit cd5b623cfd
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,7 @@
<script type="text/javascript" src="/static/js/zephyr.js"></script>
<script type="text/javascript">
var initial_zephyr_json = {{ zephyr_json }};
var username = "{{ user_profile.user.username }}";
</script>
<div class="row-fluid">

View File

@ -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();
}