• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/imapcommands/mailsfoldersmanager.php
  • Класс: BitrixMailImapCommandsMailsFoldersManager
  • Вызов: MailsFoldersManager::processMoving
private function processMoving($messagesToMove, $destinationDirectory)
{
	if (!$messagesToMove)
	{
		return new MainResult();
	}
	$result = $this->moveMailsByImap($messagesToMove, $destinationDirectory);
	if ($result->isSuccess())
	{
		$this->repository->updateMessageFieldsAfterMove($this->messages, $destinationDirectory, $this->mailbox);
		$this->imapSyncMovedMessages($messagesToMove, $destinationDirectory);
		return (new MainResult())->setData($messagesToMove);
	}
	else
	{
		return (new MainResult())->addError(new MainError(Loc::getMessage('MAIL_CLIENT_SYNC_ERROR'), 'MAIL_CLIENT_SYNC_ERROR'));
	}
}