mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
Add support for replying to huddle messages.
(imported from commit 21c760838fa87bf524ff178eab6473dfa3c6921c)
This commit is contained in:
@@ -138,6 +138,8 @@ $(document).keydown(function(event) {
|
|||||||
} else if (event.keyCode == 82) { // 'r' keypress, for responding to a zephyr
|
} else if (event.keyCode == 82) { // 'r' keypress, for responding to a zephyr
|
||||||
var parent = $("#selected").parents("tr");
|
var parent = $("#selected").parents("tr");
|
||||||
var zephyr_class = parent.find("span.zephyr_class").text();
|
var zephyr_class = parent.find("span.zephyr_class").text();
|
||||||
|
var zephyr_huddle = parent.find("span.zephyr_huddle_recipient").text();
|
||||||
|
var zephyr_personal = parent.find("span.zephyr_personal_recipient").text();
|
||||||
var instance = parent.find("span.zephyr_instance").text();
|
var instance = parent.find("span.zephyr_instance").text();
|
||||||
if (zephyr_class != '') {
|
if (zephyr_class != '') {
|
||||||
$('#zephyr-type-tabs a[href="#class-message"]').tab('show');
|
$('#zephyr-type-tabs a[href="#class-message"]').tab('show');
|
||||||
@@ -145,7 +147,13 @@ $(document).keydown(function(event) {
|
|||||||
$("#instance").val(instance);
|
$("#instance").val(instance);
|
||||||
$("#new_zephyr").focus();
|
$("#new_zephyr").focus();
|
||||||
$("#new_zephyr").select();
|
$("#new_zephyr").select();
|
||||||
} else { // must be a personal
|
} else if (zephyr_huddle != '') {
|
||||||
|
var recipients = parent.find("span.zephyr_huddle_recipients_list").text();
|
||||||
|
$('#zephyr-type-tabs a[href="#personal-message"]').tab('show');
|
||||||
|
$("#recipient").val(recipients);
|
||||||
|
$("#new_personal_zephyr").focus();
|
||||||
|
$("#new_personal_zephyr").select();
|
||||||
|
} else if (zephyr_personal != '') {
|
||||||
var recipient = parent.find("span.zephyr_sender").text();
|
var recipient = parent.find("span.zephyr_sender").text();
|
||||||
if (recipient == username) { // that is, we sent the original message
|
if (recipient == username) { // that is, we sent the original message
|
||||||
recipient = parent.find("span.zephyr_personal_recipient").text();
|
recipient = parent.find("span.zephyr_personal_recipient").text();
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
<td class="pointer"><p></p></td>
|
<td class="pointer"><p></p></td>
|
||||||
<td><p>
|
<td><p>
|
||||||
{{#is_huddle}}
|
{{#is_huddle}}
|
||||||
|
<span class="hidden zephyr_huddle_recipients_list
|
||||||
|
">{{#display_recipient}}{{name}}, {{/display_recipient}}</span>
|
||||||
{{#display_recipient}}
|
{{#display_recipient}}
|
||||||
<span class="label zephyr_label_clickable zephyr_huddle_recipient"
|
<span class="label zephyr_label_clickable zephyr_huddle_recipient"
|
||||||
onclick="narrow_huddle({{id}})">{{name}}</span>
|
onclick="narrow_huddle({{id}})">{{name}}</span>
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ def zephyr(request):
|
|||||||
if ',' in recipient_data:
|
if ',' in recipient_data:
|
||||||
# This is actually a huddle message
|
# This is actually a huddle message
|
||||||
recipients = [r.strip() for r in recipient_data.split(',')]
|
recipients = [r.strip() for r in recipient_data.split(',')]
|
||||||
|
# Filter out any trailing commas
|
||||||
|
recipients = [r for r in recipients if r]
|
||||||
recipient_ids = [UserProfile.objects.get(user=User.objects.get(username=r)).id
|
recipient_ids = [UserProfile.objects.get(user=User.objects.get(username=r)).id
|
||||||
for r in recipients]
|
for r in recipients]
|
||||||
# Include the sender in the new huddle
|
# Include the sender in the new huddle
|
||||||
|
|||||||
Reference in New Issue
Block a user