Skip to content

Commit eefe494

Browse files
committed
internal_link: Generate narrow links with "channel", not "stream"
Fixes: zulip#633
1 parent e710429 commit eefe494

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/api/model/narrow.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ sealed class ApiNarrowElement {
3535
}
3636

3737
class ApiNarrowStream extends ApiNarrowElement {
38-
@override String get operator => 'stream';
38+
@override String get operator => 'channel';
3939

4040
@override final int operand;
4141

test/model/compose_test.dart

+13-13
Original file line numberDiff line numberDiff line change
@@ -248,22 +248,22 @@ hello
248248
.equals(store.realmUrl.resolve(expectedFragment));
249249
}
250250

251-
checkNarrow(streamId: 1, name: 'announce', '#narrow/stream/1-announce');
252-
checkNarrow(streamId: 378, name: 'api design', '#narrow/stream/378-api-design');
253-
checkNarrow(streamId: 391, name: 'Outreachy', '#narrow/stream/391-Outreachy');
254-
checkNarrow(streamId: 415, name: 'chat.zulip.org', '#narrow/stream/415-chat.2Ezulip.2Eorg');
255-
checkNarrow(streamId: 419, name: 'français', '#narrow/stream/419-fran.C3.A7ais');
256-
checkNarrow(streamId: 403, name: 'Hshs[™~}(.', '#narrow/stream/403-Hshs.5B.E2.84.A2~.7D.28.2E');
257-
checkNarrow(streamId: 60, name: 'twitter', nearMessageId: 1570686, '#narrow/stream/60-twitter/near/1570686');
251+
checkNarrow(streamId: 1, name: 'announce', '#narrow/channel/1-announce');
252+
checkNarrow(streamId: 378, name: 'api design', '#narrow/channel/378-api-design');
253+
checkNarrow(streamId: 391, name: 'Outreachy', '#narrow/channel/391-Outreachy');
254+
checkNarrow(streamId: 415, name: 'chat.zulip.org', '#narrow/channel/415-chat.2Ezulip.2Eorg');
255+
checkNarrow(streamId: 419, name: 'français', '#narrow/channel/419-fran.C3.A7ais');
256+
checkNarrow(streamId: 403, name: 'Hshs[™~}(.', '#narrow/channel/403-Hshs.5B.E2.84.A2~.7D.28.2E');
257+
checkNarrow(streamId: 60, name: 'twitter', nearMessageId: 1570686, '#narrow/channel/60-twitter/near/1570686');
258258

259259
checkNarrow(streamId: 48, name: 'mobile', topic: 'Welcome screen UI',
260-
'#narrow/stream/48-mobile/topic/Welcome.20screen.20UI');
260+
'#narrow/channel/48-mobile/topic/Welcome.20screen.20UI');
261261
checkNarrow(streamId: 243, name: 'mobile-team', topic: 'Podfile.lock clash #F92',
262-
'#narrow/stream/243-mobile-team/topic/Podfile.2Elock.20clash.20.23F92');
262+
'#narrow/channel/243-mobile-team/topic/Podfile.2Elock.20clash.20.23F92');
263263
checkNarrow(streamId: 377, name: 'translation/zh_tw', topic: '翻譯 "stream"',
264-
'#narrow/stream/377-translation.2Fzh_tw/topic/.E7.BF.BB.E8.AD.AF.20.22stream.22');
264+
'#narrow/channel/377-translation.2Fzh_tw/topic/.E7.BF.BB.E8.AD.AF.20.22stream.22');
265265
checkNarrow(streamId: 42, name: 'Outreachy 2016-2017', topic: '2017-18 Stream?', nearMessageId: 302690,
266-
'#narrow/stream/42-Outreachy-2016-2017/topic/2017-18.20Stream.3F/near/302690');
266+
'#narrow/channel/42-Outreachy-2016-2017/topic/2017-18.20Stream.3F/near/302690');
267267
});
268268

269269
test('DmNarrow', () {
@@ -344,11 +344,11 @@ hello
344344
await store.addUser(sender);
345345

346346
check(quoteAndReplyPlaceholder(store, message: message)).equals('''
347-
@_**Full Name|123** [said](${eg.selfAccount.realmUrl}#narrow/stream/1-test-here/topic/some.20topic/near/${message.id}): *(loading message ${message.id})*
347+
@_**Full Name|123** [said](${eg.selfAccount.realmUrl}#narrow/channel/1-test-here/topic/some.20topic/near/${message.id}): *(loading message ${message.id})*
348348
''');
349349

350350
check(quoteAndReply(store, message: message, rawContent: 'Hello world!')).equals('''
351-
@_**Full Name|123** [said](${eg.selfAccount.realmUrl}#narrow/stream/1-test-here/topic/some.20topic/near/${message.id}):
351+
@_**Full Name|123** [said](${eg.selfAccount.realmUrl}#narrow/channel/1-test-here/topic/some.20topic/near/${message.id}):
352352
```quote
353353
Hello world!
354354
```

0 commit comments

Comments
 (0)