Skip to content

Commit f3767d6

Browse files
committed
api [nfc]: Rename ApiNarrowStream to ApiNarrowChannel
Fixes parts of zulip#631
1 parent c89af39 commit f3767d6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/api/model/narrow.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ sealed class ApiNarrowElement {
3434
};
3535
}
3636

37-
class ApiNarrowStream extends ApiNarrowElement {
37+
class ApiNarrowChannel extends ApiNarrowElement {
3838
@override String get operator => 'stream';
3939

4040
@override final int operand;
4141

42-
ApiNarrowStream(this.operand, {super.negated});
42+
ApiNarrowChannel(this.operand, {super.negated});
4343

44-
factory ApiNarrowStream.fromJson(Map<String, dynamic> json) => ApiNarrowStream(
44+
factory ApiNarrowChannel.fromJson(Map<String, dynamic> json) => ApiNarrowChannel(
4545
json['operand'] as int,
4646
negated: json['negated'] as bool? ?? false,
4747
);

lib/model/internal_link.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Uri narrowLink(PerAccountStore store, Narrow narrow, {int? nearMessageId}) {
7070
fragment.write('${element.operator}/');
7171

7272
switch (element) {
73-
case ApiNarrowStream():
73+
case ApiNarrowChannel():
7474
final streamId = element.operand;
7575
final name = store.streams[streamId]?.name ?? 'unknown';
7676
final slugifiedName = _encodeHashComponent(name.replaceAll(' ', '-'));
@@ -149,7 +149,7 @@ Narrow? _interpretNarrowSegments(List<String> segments, PerAccountStore store) {
149149
assert(segments.isNotEmpty);
150150
assert(segments.length.isEven);
151151

152-
ApiNarrowStream? streamElement;
152+
ApiNarrowChannel? streamElement;
153153
ApiNarrowTopic? topicElement;
154154
ApiNarrowDm? dmElement;
155155

@@ -163,7 +163,7 @@ Narrow? _interpretNarrowSegments(List<String> segments, PerAccountStore store) {
163163
if (streamElement != null) return null;
164164
final streamId = _parseStreamOperand(operand, store);
165165
if (streamId == null) return null;
166-
streamElement = ApiNarrowStream(streamId, negated: negated);
166+
streamElement = ApiNarrowChannel(streamId, negated: negated);
167167

168168
case _NarrowOperator.topic:
169169
case _NarrowOperator.subject:

lib/model/narrow.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class StreamNarrow extends Narrow {
7676
}
7777

7878
@override
79-
ApiNarrow apiEncode() => [ApiNarrowStream(streamId)];
79+
ApiNarrow apiEncode() => [ApiNarrowChannel(streamId)];
8080

8181
@override
8282
String toString() => 'StreamNarrow($streamId)';
@@ -108,7 +108,7 @@ class TopicNarrow extends Narrow implements SendableNarrow {
108108
}
109109

110110
@override
111-
ApiNarrow apiEncode() => [ApiNarrowStream(streamId), ApiNarrowTopic(topic)];
111+
ApiNarrow apiEncode() => [ApiNarrowChannel(streamId), ApiNarrowTopic(topic)];
112112

113113
@override
114114
StreamDestination get destination => StreamDestination(streamId, topic);

0 commit comments

Comments
 (0)