HyM attachments resolve: #2 #3

Merged
Juan merged 15 commits from login into main 2025-04-24 16:52:58 +00:00
Showing only changes of commit fb9f7135dd - Show all commits

View File

@ -1,5 +1,7 @@
//data structures
import 'dart:typed_data';
class GetThreadResponse {
final int id;
final List<String> messages;
@ -76,7 +78,7 @@ class SerializableMessage {
required this.subject,
required this.date,
required this.uid,
required this.list,
required this.list, //email list???
required this.id,
required this.in_reply_to,
});
@ -118,3 +120,29 @@ class AttachmentInfo {
);
}
}
class AttachmentInfoList extends Iterable<AttachmentInfo> {
final List<AttachmentInfo> _attachments;
AttachmentInfoList(this._attachments);
factory AttachmentInfoList.fromJsonList(List<Map<String, dynamic>> jsonList) {
return AttachmentInfoList(jsonList.map((json) => AttachmentInfo.fromJson(json)).toList());
}
@override
Iterator<AttachmentInfo> get iterator => _attachments.iterator;
@override
String toString() => _attachments.toString();
}
class AttachmentResponse {
final name;
final Uint8List data;
AttachmentResponse({required this.name, required this.data});
factory AttachmentResponse.fromJson(Map<String, dynamic> json) {
return AttachmentResponse(name: json["name"], data: json["data"],);
}
}