diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index 06369c5bc8..23957f79b7 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -84,8 +84,11 @@ exports.describe = function (operators) { var operand = elem[1]; switch (elem[0]) { case 'is': - if (operand === 'private-message') + if (operand === 'private-message') { return 'Narrow to all private messages'; + } else if (operand === 'starred') { + return 'Narrow to starred messages'; + } break; case 'stream': @@ -213,7 +216,12 @@ function build_filter(operators_mixed_case) { if (operand === 'private-message') { if (message.type !== 'private') return false; + } else if (operand === 'starred') { + if (!message.starred) { + return false; + } } + break; case 'in': diff --git a/zephyr/views.py b/zephyr/views.py index 9465affd1f..13ce1d9fad 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -542,6 +542,8 @@ class NarrowBuilder(object): if operand == 'private-message': return (Q(message__recipient__type=Recipient.PERSONAL) | Q(message__recipient__type=Recipient.HUDDLE)) + elif operand == 'starred': + return Q(flags=UserMessage.flags.starred) raise BadNarrowOperator("unknown 'is' operand " + operand) def by_stream(self, operand):