Files
zulip/static/js/huddle_data.js
Steve Howell 43e5b2d28b right sidebar: Remove "GROUP PMs" section.
We remove the "GROUP PMs" section that used
to be in the lower right sidebar.

Most of this is straightforward code removal.

A couple quick notes:

    - The message fetching code now just
      calls `huddle_data.process_loaded_messages`,
      which we still need for search suggestions.
      We removed `activity.process_loaded_messages`.

    - The `huddle_data.process_loaded_messages`
      function no longer needs to return `need_resize`.

    - In `resize.js` we now just calculate
      `res.buddy_list_wrapper_max_height` directly
      from `usable_height`.
2020-05-27 17:57:50 -07:00

26 lines
736 B
JavaScript

const huddle_timestamps = new Map();
exports.process_loaded_messages = function (messages) {
for (const message of messages) {
const huddle_string = people.huddle_string(message);
if (huddle_string) {
const old_timestamp = huddle_timestamps.get(huddle_string);
if (!old_timestamp || old_timestamp < message.timestamp) {
huddle_timestamps.set(huddle_string, message.timestamp);
}
}
}
};
exports.get_huddles = function () {
let huddles = Array.from(huddle_timestamps.keys());
huddles = _.sortBy(huddles, function (huddle) {
return huddle_timestamps.get(huddle);
});
return huddles.reverse();
};
window.huddle_data = exports;