TF-4392 [Team Mailbox] Hide Recover deleted messages and Archive message in team mailbox
This commit is contained in:
+2
-1
@@ -48,7 +48,8 @@ extension HandlePressEmailSelectionActionExtension on ThreadController {
|
||||
EmailSelectionActionType.markAsNotSpam
|
||||
else
|
||||
EmailSelectionActionType.markAsSpam,
|
||||
if (selectedMailbox?.isArchive != true)
|
||||
if (selectedMailbox?.isArchive != true &&
|
||||
selectedMailbox?.isChildOfTeamMailboxes != true)
|
||||
EmailSelectionActionType.archiveMessage,
|
||||
if (selectedMailbox?.isDeletePermanentlyEnabled == true)
|
||||
EmailSelectionActionType.deletePermanently,
|
||||
|
||||
@@ -107,17 +107,25 @@ mixin EmailActionController {
|
||||
return;
|
||||
}
|
||||
|
||||
final emailId = email.id;
|
||||
if (emailId == null) {
|
||||
mailboxDashBoardController.emitMoveToTrashFailure(
|
||||
NotFoundEmailIdException(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
_moveToTrashAction(
|
||||
session,
|
||||
accountId,
|
||||
MoveToMailboxRequest(
|
||||
{mailboxContain.id: email.id != null ? [email.id!] : []},
|
||||
{mailboxContain.id: [emailId]},
|
||||
trashId,
|
||||
MoveAction.moving,
|
||||
EmailActionType.moveToTrash,
|
||||
destinationPath: trashPath,
|
||||
),
|
||||
email.id != null ? {email.id!: email.hasRead} : {},
|
||||
{emailId: email.hasRead},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ mixin EmailMoreActionContextMenu on LabelSubMenuMixin {
|
||||
if (PlatformInfo.isWeb) EmailActionType.openInNewTab,
|
||||
if (!isDrafts && !isChildOfTeam)
|
||||
isSpam ? EmailActionType.unSpam : EmailActionType.moveToSpam,
|
||||
if (!isArchive) EmailActionType.archiveMessage,
|
||||
if (!isArchive && !isChildOfTeam) EmailActionType.archiveMessage,
|
||||
if (!isDrafts && !isTemplates) EmailActionType.editAsNewEmail,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1563,9 +1563,11 @@ class ThreadController extends BaseController with EmailActionController {
|
||||
return DismissDirection.none;
|
||||
}
|
||||
|
||||
return isInArchiveMailbox(email) || !hasArchiveMailbox()
|
||||
? DismissDirection.startToEnd
|
||||
: DismissDirection.horizontal;
|
||||
return isInArchiveMailbox(email) ||
|
||||
!hasArchiveMailbox() ||
|
||||
email.mailboxContain?.isChildOfTeamMailboxes == true
|
||||
? DismissDirection.startToEnd
|
||||
: DismissDirection.horizontal;
|
||||
}
|
||||
|
||||
bool isInArchiveMailbox(PresentationEmail email) => email.mailboxContain?.isArchive == true;
|
||||
|
||||
Reference in New Issue
Block a user