mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
Extract code to summary.js.
(imported from commit 51d958b27e53555f5f77d6e6b661eade57190e23)
This commit is contained in:
27
static/js/summary.js
Normal file
27
static/js/summary.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var summary = (function () {
|
||||
|
||||
// This module has helper functions for the August 2013 message
|
||||
// summarizing experiment.
|
||||
|
||||
var exports = {};
|
||||
|
||||
exports.maybe_mark_summarized = function (message) {
|
||||
if (feature_flags.summarize_read_while_narrowed) {
|
||||
if (narrow.narrowed_by_reply()) {
|
||||
// Narrowed to a topic or PM recipient
|
||||
send_summarize_in_stream(message);
|
||||
}
|
||||
|
||||
if (narrow.active() && !narrow.narrowed_to_search()) {
|
||||
// Narrowed to anything except a search
|
||||
send_summarize_in_home(message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return exports;
|
||||
}());
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = summary;
|
||||
}
|
||||
Reference in New Issue
Block a user