@@ -154,6 +154,7 @@ Narrow? _interpretNarrowSegments(List<String> segments, PerAccountStore store) {
154
154
ApiNarrowStream ? streamElement;
155
155
ApiNarrowTopic ? topicElement;
156
156
ApiNarrowDm ? dmElement;
157
+ ApiNarrowIsMentioned ? isMentionedElement;
157
158
158
159
for (var i = 0 ; i < segments.length; i += 2 ) {
159
160
final (operator , negated) = _parseOperator (segments[i]);
@@ -181,6 +182,10 @@ Narrow? _interpretNarrowSegments(List<String> segments, PerAccountStore store) {
181
182
if (dmIds == null ) return null ;
182
183
dmElement = ApiNarrowDm (dmIds, negated: negated);
183
184
185
+ case _NarrowOperator .is_:
186
+ if (isMentionedElement != null ) return null ;
187
+ if (operand == 'mentioned' ) isMentionedElement = ApiNarrowIsMentioned ();
188
+
184
189
case _NarrowOperator .near: // TODO(#82): support for near
185
190
case _NarrowOperator .with_: // TODO(#683): support for with
186
191
continue ;
@@ -190,7 +195,10 @@ Narrow? _interpretNarrowSegments(List<String> segments, PerAccountStore store) {
190
195
}
191
196
}
192
197
193
- if (dmElement != null ) {
198
+ if (isMentionedElement != null ) {
199
+ if (streamElement != null || topicElement != null || dmElement != null ) return null ;
200
+ return const MentionsNarrow ();
201
+ } else if (dmElement != null ) {
194
202
if (streamElement != null || topicElement != null ) return null ;
195
203
return DmNarrow .withUsers (dmElement.operand, selfUserId: store.selfUserId);
196
204
} else if (streamElement != null ) {
@@ -212,6 +220,9 @@ enum _NarrowOperator {
212
220
// cannot use `with` as it is a reserved keyword in Dart
213
221
@JsonValue ('with' )
214
222
with_,
223
+ // cannot use `is` as it is a reserved keyword in Dart
224
+ @JsonValue ('is' )
225
+ is_,
215
226
pmWith,
216
227
stream,
217
228
channel,
0 commit comments