Implement components + uploads flow and gateway-aligned payloads

This commit is contained in:
Foxyz committed 2026-02-20 17:41:08 +03:00
1 parent 458be6f991
commit a93d619b4c
7 files changed
+440 -11

No files matched your search

+31 -1
View File
@@ -28,7 +28,7 @@ class ChatUser {
String? bio;
// Identity
String publicKey; // Ed25519 public key, always stored
String publicKey; // ECDSA public key, always stored
// HOME SERVER ONLY: Auth & key backup
String? passwordHash;
@@ -106,6 +106,7 @@ class ChatMessage {
String? authorAvatarUrl;
String content;
String componentsJson;
@Property(type: PropertyType.date)
DateTime createdAt;
@@ -119,9 +120,38 @@ class ChatMessage {
required this.authorUserId,
required this.authorUsername,
required this.content,
required this.componentsJson,
this.authorHomeServer,
this.authorAvatarUrl,
DateTime? createdAt,
this.editedAt,
}) : createdAt = createdAt ?? DateTime.now();
}
@Entity()
class ChatFile {
@Id()
int id = 0;
int uploaderId;
String path;
String mimeType;
int width;
int height;
int sizeBytes;
bool isAttached;
@Property(type: PropertyType.date)
DateTime createdAt;
ChatFile({
required this.uploaderId,
required this.path,
required this.mimeType,
required this.width,
required this.height,
required this.sizeBytes,
this.isAttached = false,
DateTime? createdAt,
}) : createdAt = createdAt ?? DateTime.now();
}