mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
home.py: move event_queue_id as queue_id to register_ret.
Simplify the page_params generation logic #3853
This commit is contained in:
@@ -129,7 +129,7 @@ function create_message_object() {
|
|||||||
type: compose_state.get_message_type(),
|
type: compose_state.get_message_type(),
|
||||||
content: content,
|
content: content,
|
||||||
sender_id: page_params.user_id,
|
sender_id: page_params.user_id,
|
||||||
queue_id: page_params.event_queue_id,
|
queue_id: page_params.queue_id,
|
||||||
stream: '',
|
stream: '',
|
||||||
subject: '',
|
subject: '',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ function resend_message(message, row) {
|
|||||||
retry_spinner.toggleClass('rotating', true);
|
retry_spinner.toggleClass('rotating', true);
|
||||||
// Always re-set queue_id if we've gotten a new one
|
// Always re-set queue_id if we've gotten a new one
|
||||||
// since the time when the message object was initially created
|
// since the time when the message object was initially created
|
||||||
message.queue_id = page_params.event_queue_id;
|
message.queue_id = page_params.queue_id;
|
||||||
var start_time = new Date();
|
var start_time = new Date();
|
||||||
compose.transmit_message(message, function success(data) {
|
compose.transmit_message(message, function success(data) {
|
||||||
retry_spinner.toggleClass('rotating', false);
|
retry_spinner.toggleClass('rotating', false);
|
||||||
@@ -567,7 +567,7 @@ $(document).on('socket_loaded_requests.zulip', function (event, data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
msg.local_id = next_local_id;
|
msg.local_id = next_local_id;
|
||||||
msg.queue_id = page_params.event_queue_id;
|
msg.queue_id = page_params.queue_id;
|
||||||
|
|
||||||
next_local_id = truncate_precision(next_local_id + 0.01);
|
next_local_id = truncate_precision(next_local_id + 0.01);
|
||||||
msgs_to_insert.push(msg);
|
msgs_to_insert.push(msg);
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ function get_events(options) {
|
|||||||
|
|
||||||
get_events_params.dont_block = options.dont_block || get_events_failures > 0;
|
get_events_params.dont_block = options.dont_block || get_events_failures > 0;
|
||||||
if (get_events_params.queue_id === undefined) {
|
if (get_events_params.queue_id === undefined) {
|
||||||
get_events_params.queue_id = page_params.event_queue_id;
|
get_events_params.queue_id = page_params.queue_id;
|
||||||
get_events_params.last_event_id = page_params.last_event_id;
|
get_events_params.last_event_id = page_params.last_event_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,7 +591,7 @@ exports.cleanup_event_queue = function cleanup_event_queue() {
|
|||||||
page_params.event_queue_expired = true;
|
page_params.event_queue_expired = true;
|
||||||
channel.del({
|
channel.del({
|
||||||
url: '/json/events',
|
url: '/json/events',
|
||||||
data: {queue_id: page_params.event_queue_id},
|
data: {queue_id: page_params.queue_id},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ Socket.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_get_next_req_id: function Socket__get_next_req_id() {
|
_get_next_req_id: function Socket__get_next_req_id() {
|
||||||
var req_id = page_params.event_queue_id + ':' + this._next_req_id_counter;
|
var req_id = page_params.queue_id + ':' + this._next_req_id_counter;
|
||||||
this._next_req_id_counter += 1;
|
this._next_req_id_counter += 1;
|
||||||
return req_id;
|
return req_id;
|
||||||
},
|
},
|
||||||
@@ -214,7 +214,7 @@ Socket.prototype = {
|
|||||||
$(function () {
|
$(function () {
|
||||||
var request = that._make_request('auth');
|
var request = that._make_request('auth');
|
||||||
request.msg = {csrf_token: csrf_token,
|
request.msg = {csrf_token: csrf_token,
|
||||||
queue_id: page_params.event_queue_id,
|
queue_id: page_params.queue_id,
|
||||||
status_inquiries: _.keys(that._requests)};
|
status_inquiries: _.keys(that._requests)};
|
||||||
request.success = function (resp) {
|
request.success = function (resp) {
|
||||||
that._is_authenticated = true;
|
that._is_authenticated = true;
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ class HomeTest(ZulipTestCase):
|
|||||||
"enable_offline_push_notifications",
|
"enable_offline_push_notifications",
|
||||||
"enable_online_push_notifications",
|
"enable_online_push_notifications",
|
||||||
"enter_sends",
|
"enter_sends",
|
||||||
"event_queue_id",
|
|
||||||
"first_in_realm",
|
"first_in_realm",
|
||||||
"fullname",
|
"fullname",
|
||||||
"furthest_read_time",
|
"furthest_read_time",
|
||||||
@@ -93,6 +92,7 @@ class HomeTest(ZulipTestCase):
|
|||||||
"poll_timeout",
|
"poll_timeout",
|
||||||
"presences",
|
"presences",
|
||||||
"prompt_for_invites",
|
"prompt_for_invites",
|
||||||
|
"queue_id",
|
||||||
"realm_add_emoji_by_admins_only",
|
"realm_add_emoji_by_admins_only",
|
||||||
"realm_allow_message_editing",
|
"realm_allow_message_editing",
|
||||||
"realm_authentication_methods",
|
"realm_authentication_methods",
|
||||||
|
|||||||
@@ -242,7 +242,6 @@ def home_real(request):
|
|||||||
# TODO: Rename these to match register_ret values.
|
# TODO: Rename these to match register_ret values.
|
||||||
people_list = register_ret['realm_users'],
|
people_list = register_ret['realm_users'],
|
||||||
initial_pointer = register_ret['pointer'],
|
initial_pointer = register_ret['pointer'],
|
||||||
event_queue_id = register_ret['queue_id'],
|
|
||||||
|
|
||||||
# Misc. extra data.
|
# Misc. extra data.
|
||||||
have_initial_messages = user_has_messages,
|
have_initial_messages = user_has_messages,
|
||||||
@@ -276,6 +275,7 @@ def home_real(request):
|
|||||||
'muted_topics',
|
'muted_topics',
|
||||||
'never_subscribed',
|
'never_subscribed',
|
||||||
'presences',
|
'presences',
|
||||||
|
'queue_id',
|
||||||
'realm_add_emoji_by_admins_only',
|
'realm_add_emoji_by_admins_only',
|
||||||
'realm_allow_message_editing',
|
'realm_allow_message_editing',
|
||||||
'realm_authentication_methods',
|
'realm_authentication_methods',
|
||||||
|
|||||||
Reference in New Issue
Block a user