message edit: Move and clarify an important comment.

This commit is contained in:
Tim Abbott 2020-06-15 10:47:10 -07:00
parent 0cffaa7b5d
commit ba2de34414
2 changed files with 8 additions and 3 deletions

View File

@ -179,6 +179,14 @@ exports.update_messages = function update_messages(events) {
// Remove the recent topics entry for the old topics;
// must be called before we call set_message_topic.
//
// TODO: Use a single bulk request to do this removal.
// Note that we need to be careful to only remove IDs
// that were present in stream_topic_history data.
// This may not be possible to do correctly without extra
// complexity; the present loop assumes stream_topic_history has
// only messages in message_store, but that's been false
// since we added the server_history feature.
stream_topic_history.remove_message({
stream_id: msg.stream_id,
topic_name: msg.topic,

View File

@ -199,9 +199,6 @@ exports.per_stream_history = function (stream_id) {
exports.remove_message = function (opts) {
const stream_id = opts.stream_id;
const topic_name = opts.topic_name;
// Number of messages to remove
// TODO: Use this option when moving
// topic between stream in message_events.js
const num_messages = opts.num_messages || 1;
const history = stream_dict.get(stream_id);