From bf08e33648b5d9c7b3aceb75028c9961379c10ff Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 11 Feb 2014 11:22:23 -0500 Subject: [PATCH] Revert "Ensure server still gets narrow operators as tuples." This reverts commit 64aced74012101f3bdbd3a4e6066b46ad8e1f4ea, which was always intended as temporary code until we upgraded the back end to support dictionary-style narrow operators. (imported from commit b8d3a19f3aad3d9d6a26b9dcc07f502c55b18edd) --- static/js/message_store.js | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/static/js/message_store.js b/static/js/message_store.js index 372f8889e0..278b38b961 100644 --- a/static/js/message_store.js +++ b/static/js/message_store.js @@ -165,19 +165,6 @@ exports.add_messages = function add_messages(messages, msg_list, opts) { } }; -function server_style(operators) { - // Our server still accepts narrow terms in the old-school tuple - // format, and it will support that style for a while, since we have - // some legacy clients in the wild. But soon the server will also - // support new-style operators, so this function is just temporary. - // (There are some complications in making the server support both, - // so even though this code is kind of throwaway, it is a safer - // path to the end game.) - return _.map(operators, function (term) { - return [term.operator, term.operand]; - }); -} - function maybe_add_narrowed_messages(messages, msg_list, messages_are_new) { var ids = []; _.each(messages, function (elem) { @@ -188,7 +175,7 @@ function maybe_add_narrowed_messages(messages, msg_list, messages_are_new) { url: '/json/messages_in_narrow', idempotent: true, data: {msg_ids: JSON.stringify(ids), - narrow: JSON.stringify(server_style(narrow.public_operators()))}, + narrow: JSON.stringify(narrow.public_operators())}, timeout: 5000, success: function (data) { if (msg_list !== current_msg_list) { @@ -418,10 +405,10 @@ exports.load_old_messages = function load_old_messages(opts) { if (page_params.narrow !== undefined) { operators = operators.concat(page_params.narrow); } - data.narrow = JSON.stringify(server_style(operators)); + data.narrow = JSON.stringify(operators); } if (opts.msg_list === home_msg_list && page_params.narrow_stream !== undefined) { - data.narrow = JSON.stringify(server_style(page_params.narrow)); + data.narrow = JSON.stringify(page_params.narrow); } if (opts.use_first_unread_anchor) { data.use_first_unread_anchor = true;