mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
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:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user