TF-4068 Change profile (set identity as default) in setting
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import 'package:jmap_dart_client/jmap/core/unsigned_int.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/model/identity_signature.dart';
|
||||
|
||||
extension IdentityExtension on Identity {
|
||||
@@ -16,4 +18,32 @@ extension IdentityExtension on Identity {
|
||||
IdentitySignature? toIdentitySignature() => id != null
|
||||
? IdentitySignature(identityId: id!, signature: signatureAsString)
|
||||
: null;
|
||||
|
||||
Identity asDefault() => copyWith(sortOrder: UnsignedInt(0));
|
||||
|
||||
Identity copyWith({
|
||||
IdentityId? id,
|
||||
String? description,
|
||||
String? name,
|
||||
String? email,
|
||||
Set<EmailAddress>? bcc,
|
||||
Set<EmailAddress>? replyTo,
|
||||
Signature? textSignature,
|
||||
Signature? htmlSignature,
|
||||
bool? mayDelete,
|
||||
UnsignedInt? sortOrder,
|
||||
}) {
|
||||
return Identity(
|
||||
id: id ?? this.id,
|
||||
description: description ?? this.description,
|
||||
name: name ?? this.name,
|
||||
email: email ?? this.email,
|
||||
bcc: bcc ?? this.bcc,
|
||||
replyTo: replyTo ?? this.replyTo,
|
||||
textSignature: textSignature ?? this.textSignature,
|
||||
htmlSignature: htmlSignature ?? this.htmlSignature,
|
||||
mayDelete: mayDelete ?? this.mayDelete,
|
||||
sortOrder: sortOrder ?? this.sortOrder,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user