mirror of https://github.com/zulip/zulip.git
Automatically subscribe on send when lurking
(imported from commit 636c07346e766615a0012e4532f35d328bb7984d)
This commit is contained in:
parent
64ebbc6c73
commit
2797a41fd8
|
@ -302,6 +302,15 @@ function validate_stream_message() {
|
|||
// browser window doesn't know it.
|
||||
return true;
|
||||
case "not-subscribed":
|
||||
if (lurk_stream.toLowerCase() === stream_name.toLowerCase()) {
|
||||
// Just subscribe them.
|
||||
subs.subscribe_for_send(stream_name);
|
||||
// When the subscription request completes,
|
||||
// subscribe_for_send will send our message (like when
|
||||
// the user clicks on subscribe-and-send).
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#send-status').removeClass(status_classes);
|
||||
$('#stream-nosub-name').text(stream_name);
|
||||
$('#stream-nosub').show();
|
||||
|
|
|
@ -183,7 +183,8 @@ exports.subscribe_for_send = function (stream, prompt_button) {
|
|||
success: function (response) {
|
||||
add_to_stream_list(stream);
|
||||
compose.finish();
|
||||
prompt_button.stop(true).fadeOut(500);
|
||||
if (prompt_button !== undefined)
|
||||
prompt_button.stop(true).fadeOut(500);
|
||||
},
|
||||
error: function (xhr, error_type, exn) {
|
||||
ui.report_error("Unable to subscribe", xhr, $("#home-error"));
|
||||
|
|
Loading…
Reference in New Issue