Skip to content

Commit 22be3a4

Browse files
committed
api [nfc]: Implement empty() on GetMessagesResult
1 parent cad5947 commit 22be3a4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/api/route/messages.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ class GetMessagesResult {
150150
required this.messages,
151151
});
152152

153+
/// An example empty result, for use in tests.
154+
GetMessagesResult.empty() :
155+
// this `anchor` was observed empirically;
156+
// also, it's not representative of all requests.
157+
anchor = 10000000000000000,
158+
foundNewest = true,
159+
foundOldest = true,
160+
foundAnchor = false,
161+
historyLimited = false, // not representative of all requests
162+
messages = [];
163+
153164
factory GetMessagesResult.fromJson(Map<String, dynamic> json) =>
154165
_$GetMessagesResultFromJson(json);
155166

0 commit comments

Comments
 (0)