Init mailbox feature add domain layer
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
extension MailboxExtension on Mailbox {
|
||||
|
||||
PresentationMailbox toPresentationMailbox({SelectMode selectMode = SelectMode.INACTIVE}) {
|
||||
return PresentationMailbox(
|
||||
id,
|
||||
name: name,
|
||||
parentId: parentId,
|
||||
role: role,
|
||||
sortOrder: sortOrder,
|
||||
totalEmails: totalEmails,
|
||||
unreadEmails: unreadEmails,
|
||||
totalThreads: totalThreads,
|
||||
unreadThreads: unreadThreads,
|
||||
myRights: myRights,
|
||||
isSubscribed: isSubscribed,
|
||||
selectMode: selectMode
|
||||
);
|
||||
}
|
||||
|
||||
bool hasRole() => role != null && role!.value.isNotEmpty;
|
||||
}
|
||||
Reference in New Issue
Block a user