Skip to content

Commit 6cce020

Browse files
committed
api [nfc]: Use resolveDmElements in narrowLink
1 parent 806a81a commit 6cce020

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/model/internal_link.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,16 @@ String? decodeHashComponent(String str) {
5656
// When you want to point the server to a location in a message list, you
5757
// you do so by passing the `anchor` param.
5858
Uri narrowLink(PerAccountStore store, Narrow narrow, {int? nearMessageId}) {
59-
final apiNarrow = narrow.apiEncode();
59+
// TODO(server-7)
60+
final apiNarrow = resolveDmElements(
61+
narrow.apiEncode(), store.connection.zulipFeatureLevel!);
6062
final fragment = StringBuffer('narrow');
6163
for (ApiNarrowElement element in apiNarrow) {
6264
fragment.write('/');
6365
if (element.negated) {
6466
fragment.write('-');
6567
}
6668

67-
if (element is ApiNarrowDm) {
68-
final supportsOperatorDm = store.connection.zulipFeatureLevel! >= 177; // TODO(server-7)
69-
element = element.resolve(legacy: !supportsOperatorDm);
70-
}
71-
7269
fragment.write('${element.operator}/');
7370

7471
switch (element) {

0 commit comments

Comments
 (0)