add support for jumping to out-of-context events (#95)
Fixes #84. Reviewed-on: #95
This commit is contained in:
parent
3429a3ed98
commit
389b65ae61
16 changed files with 463 additions and 132 deletions
17
lib/models/requests/get_event_context.dart
Normal file
17
lib/models/requests/get_event_context.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
|
||||
part "get_event_context.freezed.dart";
|
||||
part "get_event_context.g.dart";
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const GetEventContextRequest({
|
||||
required final String roomId,
|
||||
required final String eventId,
|
||||
final int limit = 20,
|
||||
}) with _$GetEventContextRequest {
|
||||
Map<String, Object?> toJson() => _$GetEventContextRequestToJson(this);
|
||||
|
||||
factory GetEventContextRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$GetEventContextRequestFromJson(json);
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ part "get_mentions.g.dart";
|
|||
class GetMentionsRequest({
|
||||
@EpochDateTimeConverter() required final DateTime maxTimestamp,
|
||||
@JsonKey(name: "type") required final UnreadType unreadType,
|
||||
required final int limit,
|
||||
final int limit = 20,
|
||||
final String? roomId,
|
||||
}) with _$GetMentionsRequest {
|
||||
Map<String, Object?> toJson() => _$GetMentionsRequestToJson(this);
|
||||
|
|
|
|||
22
lib/models/requests/paginate_manual.dart
Normal file
22
lib/models/requests/paginate_manual.dart
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/direction.dart";
|
||||
|
||||
part "paginate_manual.freezed.dart";
|
||||
part "paginate_manual.g.dart";
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const PaginateManualRequest({
|
||||
required final String roomId,
|
||||
// Root event ID of a thread to paginate
|
||||
final String? threadRoot,
|
||||
// Can be null for starting pagination of a thread
|
||||
final String? since,
|
||||
required final Direction direction,
|
||||
final int limit = 20,
|
||||
}) with _$PaginateManualRequest {
|
||||
Map<String, Object?> toJson() => _$PaginateManualRequestToJson(this);
|
||||
|
||||
factory PaginateManualRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$PaginateManualRequestFromJson(json);
|
||||
}
|
||||
Loading…
Reference in a new issue