Remove topic_data.process_message().

We now call topic_data.add_message() and
topic_data.remove_message() when we get info about
incoming messages.  The old way of passing in a boolean
made the calling code hard to read and added unncessary
conditional logic to the codepath.

We also have vague plans to change how we handle
removing topics, since increment/decrement logic is now
kind of fragile, so making the "remove" path more explicit
prepares us to something smarter in the future, like just
figure out when the last topic has been removed by calling
a filter function or something outside of topic_data.js.

Another thing to note here is that the code changed here
in echo.js is dead code, since we've disabled
message editing for locally edited messages.  I considered
removing this code in a preparatory commit, but there's
other PR activity related to local echo that I don't want
to conflict with.

One nice aspect of removing process_message() is that
the new topic_data.js module does not refer to the legacy
field "subject" any more, nor do its node tests.
This commit is contained in:
Steve Howell
2017-07-26 08:05:25 -04:00
committed by Tim Abbott
parent 5a8bccfe08
commit a9e296db74
6 changed files with 58 additions and 46 deletions

View File

@@ -1,7 +1,6 @@
add_dependencies({
people: 'js/people.js',
pm_conversations: 'js/pm_conversations.js',
topic_data: 'js/topic_data.js',
util: 'js/util.js',
});
@@ -17,7 +16,7 @@ set_global('alert_words', {
});
set_global('topic_data' , {
process_message: noop,
add_message: noop,
});
set_global('recent_senders', {