Always create mailbox with isSubscribed = true
This commit is contained in:
@@ -111,7 +111,12 @@ class EmailAPI with HandleSetErrorMixin {
|
||||
final setMailboxMethod = SetMailboxMethod(accountId)
|
||||
..addCreate(
|
||||
mailboxRequest.creationId,
|
||||
Mailbox(name: mailboxRequest.newName, parentId: mailboxRequest.parentId));
|
||||
Mailbox(
|
||||
name: mailboxRequest.newName,
|
||||
parentId: mailboxRequest.parentId,
|
||||
isSubscribed: IsSubscribed(mailboxRequest.isSubscribed)
|
||||
)
|
||||
);
|
||||
|
||||
requestBuilder.invocation(setMailboxMethod);
|
||||
|
||||
|
||||
@@ -137,7 +137,14 @@ class MailboxAPI with HandleSetErrorMixin {
|
||||
|
||||
Future<Mailbox?> createNewMailbox(AccountId accountId, CreateNewMailboxRequest request) async {
|
||||
final setMailboxMethod = SetMailboxMethod(accountId)
|
||||
..addCreate(request.creationId, Mailbox(name: request.newName, parentId: request.parentId));
|
||||
..addCreate(
|
||||
request.creationId,
|
||||
Mailbox(
|
||||
name: request.newName,
|
||||
isSubscribed: IsSubscribed(request.isSubscribed),
|
||||
parentId: request.parentId
|
||||
)
|
||||
);
|
||||
|
||||
final requestBuilder = JmapRequestBuilder(httpClient, ProcessingInvocation());
|
||||
|
||||
|
||||
@@ -8,9 +8,22 @@ class CreateNewMailboxRequest with EquatableMixin {
|
||||
final MailboxName newName;
|
||||
final Id creationId;
|
||||
final MailboxId? parentId;
|
||||
final bool isSubscribed;
|
||||
|
||||
CreateNewMailboxRequest(this.creationId, this.newName, {this.parentId});
|
||||
CreateNewMailboxRequest(
|
||||
this.creationId,
|
||||
this.newName,
|
||||
{
|
||||
this.parentId,
|
||||
this.isSubscribed = true
|
||||
}
|
||||
);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [creationId, newName, parentId];
|
||||
List<Object?> get props => [
|
||||
creationId,
|
||||
newName,
|
||||
parentId,
|
||||
isSubscribed
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user