typing_notifications: Send requests only if send_private_typing_notifications.

This commit is contained in:
Dinesh 2021-07-26 01:17:34 +05:30 committed by Tim Abbott
parent 9cea88c1a5
commit b41918e74e
1 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import * as channel from "./channel";
import * as compose_pm_pill from "./compose_pm_pill"; import * as compose_pm_pill from "./compose_pm_pill";
import * as compose_state from "./compose_state"; import * as compose_state from "./compose_state";
import * as people from "./people"; import * as people from "./people";
import {user_settings} from "./user_settings";
// This module handles the outbound side of typing indicators. // This module handles the outbound side of typing indicators.
// We detect changes in the compose box and notify the server // We detect changes in the compose box and notify the server
@ -51,11 +52,15 @@ function get_current_time() {
} }
function notify_server_start(user_ids_array) { function notify_server_start(user_ids_array) {
if (user_settings.send_private_typing_notifications) {
send_typing_notification_ajax(user_ids_array, "start"); send_typing_notification_ajax(user_ids_array, "start");
}
} }
function notify_server_stop(user_ids_array) { function notify_server_stop(user_ids_array) {
if (user_settings.send_private_typing_notifications) {
send_typing_notification_ajax(user_ids_array, "stop"); send_typing_notification_ajax(user_ids_array, "stop");
}
} }
export const get_recipient = get_user_ids_array; export const get_recipient = get_user_ids_array;