forked from Henry-Hiles/nexus
working message rendering
This commit is contained in:
parent
a28bced44d
commit
7c76bb6e66
20 changed files with 305 additions and 197 deletions
|
|
@ -23,7 +23,7 @@ abstract class Event with _$Event {
|
|||
String? transactionId,
|
||||
String? redactedBy,
|
||||
String? relatesTo,
|
||||
@JsonKey(name: "relates_type") String? relationType,
|
||||
String? relationType,
|
||||
String? decryptionError,
|
||||
String? sendError,
|
||||
@Default(IMap.empty()) IMap<String, int> reactions,
|
||||
|
|
|
|||
15
lib/models/get_event_request.dart
Normal file
15
lib/models/get_event_request.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "get_event_request.freezed.dart";
|
||||
part "get_event_request.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class GetEventRequest with _$GetEventRequest {
|
||||
const factory GetEventRequest({
|
||||
required String roomId,
|
||||
required String eventId,
|
||||
@Default(false) bool unredact,
|
||||
}) = _GetEventRequest;
|
||||
|
||||
factory GetEventRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$GetEventRequestFromJson(json);
|
||||
}
|
||||
15
lib/models/get_related_events_request.dart
Normal file
15
lib/models/get_related_events_request.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "get_related_events_request.freezed.dart";
|
||||
part "get_related_events_request.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class GetRelatedEventsRequest with _$GetRelatedEventsRequest {
|
||||
const factory GetRelatedEventsRequest({
|
||||
required String roomId,
|
||||
required String eventId,
|
||||
required String relationType,
|
||||
}) = _GetRelatedEventsRequest;
|
||||
|
||||
factory GetRelatedEventsRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$GetRelatedEventsRequestFromJson(json);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "login.freezed.dart";
|
||||
part "login.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class Login with _$Login {
|
||||
const factory Login({
|
||||
required String username,
|
||||
required String password,
|
||||
required String homeserverUrl,
|
||||
}) = _Login;
|
||||
|
||||
factory Login.fromJson(Map<String, Object?> json) => _$LoginFromJson(json);
|
||||
}
|
||||
15
lib/models/login_request.dart
Normal file
15
lib/models/login_request.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "login_request.freezed.dart";
|
||||
part "login_request.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class LoginRequest with _$LoginRequest {
|
||||
const factory LoginRequest({
|
||||
required String username,
|
||||
required String password,
|
||||
required String homeserverUrl,
|
||||
}) = _LoginRequest;
|
||||
|
||||
factory LoginRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$LoginRequestFromJson(json);
|
||||
}
|
||||
29
lib/models/profile.dart
Normal file
29
lib/models/profile.dart
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "profile.freezed.dart";
|
||||
part "profile.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class Profile with _$Profile {
|
||||
const factory Profile({
|
||||
String? avatarUrl,
|
||||
@JsonKey(name: "displayname") String? displayName,
|
||||
@JsonKey(name: "us.cloke.msc4175.tz") String? timezone,
|
||||
|
||||
@Default(IList.empty())
|
||||
@JsonKey(name: "io.fsky.nyx.pronouns")
|
||||
IList<Pronoun> pronouns,
|
||||
}) = _Profile;
|
||||
|
||||
factory Profile.fromJson(Map<String, Object?> json) =>
|
||||
_$ProfileFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Pronoun with _$Pronoun {
|
||||
const factory Pronoun({required String language, required String summary}) =
|
||||
_Pronoun;
|
||||
|
||||
factory Pronoun.fromJson(Map<String, Object?> json) =>
|
||||
_$PronounFromJson(json);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "report.freezed.dart";
|
||||
part "report.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class Report with _$Report {
|
||||
const factory Report({
|
||||
required String roomId,
|
||||
required String eventId,
|
||||
String? reason,
|
||||
}) = _Report;
|
||||
|
||||
factory Report.fromJson(Map<String, Object?> json) => _$ReportFromJson(json);
|
||||
}
|
||||
15
lib/models/report_request.dart
Normal file
15
lib/models/report_request.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "report_request.freezed.dart";
|
||||
part "report_request.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class ReportRequest with _$ReportRequest {
|
||||
const factory ReportRequest({
|
||||
required String roomId,
|
||||
required String eventId,
|
||||
String? reason,
|
||||
}) = _ReportRequest;
|
||||
|
||||
factory ReportRequest.fromJson(Map<String, Object?> json) =>
|
||||
_$ReportRequestFromJson(json);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue