mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
Automatically subscribe on send when lurking
(imported from commit 636c07346e766615a0012e4532f35d328bb7984d)
This commit is contained in:
@@ -302,6 +302,15 @@ function validate_stream_message() {
|
|||||||
// browser window doesn't know it.
|
// browser window doesn't know it.
|
||||||
return true;
|
return true;
|
||||||
case "not-subscribed":
|
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);
|
$('#send-status').removeClass(status_classes);
|
||||||
$('#stream-nosub-name').text(stream_name);
|
$('#stream-nosub-name').text(stream_name);
|
||||||
$('#stream-nosub').show();
|
$('#stream-nosub').show();
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ exports.subscribe_for_send = function (stream, prompt_button) {
|
|||||||
success: function (response) {
|
success: function (response) {
|
||||||
add_to_stream_list(stream);
|
add_to_stream_list(stream);
|
||||||
compose.finish();
|
compose.finish();
|
||||||
|
if (prompt_button !== undefined)
|
||||||
prompt_button.stop(true).fadeOut(500);
|
prompt_button.stop(true).fadeOut(500);
|
||||||
},
|
},
|
||||||
error: function (xhr, error_type, exn) {
|
error: function (xhr, error_type, exn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user