diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +61,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version diff --git a/Model/Behavior/MailQueueBehavior.php b/Model/Behavior/MailQueueBehavior.php index 790bf7d..ed841c0 100644 --- a/Model/Behavior/MailQueueBehavior.php +++ b/Model/Behavior/MailQueueBehavior.php @@ -529,10 +529,12 @@ private function __getSettingPluginKey(Model $model) { * @param Model $model モデル * @param array $sendTimes メール送信日時 配列 * @param string $typeKey メールの種類 + * @param string $sendRoomPermission 送信するルームの役割。ルームでないときは無視される * @return void */ public function saveQueue(Model $model, $sendTimes = null, - $typeKey = MailSettingFixedPhrase::DEFAULT_TYPE) { + $typeKey = MailSettingFixedPhrase::DEFAULT_TYPE, + $sendRoomPermission = null) { $model->Behaviors->load('Mails.IsMailSend', $this->settings[$model->alias]); $languageId = Current::read('Language.id'); @@ -568,7 +570,7 @@ public function saveQueue(Model $model, $sendTimes = null, // 投稿メール - ルーム配信 $this->saveQueuePostMail($model, $languageId, $sendTimes, $userIds, $toAddresses, - $roomId, $typeKey); + $roomId, $typeKey, $sendRoomPermission); } else { //$workflowType == self::MAIL_QUEUE_WORKFLOW_TYPE_NONE || @@ -580,7 +582,7 @@ public function saveQueue(Model $model, $sendTimes = null, // メールキューSave $this->saveQueuePostMail($model, $languageId, $sendTimes, $userIds, $toAddresses, - $roomId, $typeKey); + $roomId, $typeKey, $sendRoomPermission); } } @@ -595,11 +597,13 @@ public function saveQueue(Model $model, $sendTimes = null, * @param array $toAddresses 送信先メールアドレス 配列 * @param int $roomId ルームID * @param string $typeKey メールの種類 + * @param string $sendRoomPermission 送信するルームの役割。$roomIdとセットに使用する * @return void * @throws InternalErrorException */ public function saveQueuePostMail(Model $model, $languageId, $sendTimes = null, $userIds = null, - $toAddresses = null, $roomId = null, $typeKey = MailSettingFixedPhrase::DEFAULT_TYPE) { + $toAddresses = null, $roomId = null, $typeKey = MailSettingFixedPhrase::DEFAULT_TYPE, + $sendRoomPermission = null) { $model->Behaviors->load('Mails.IsMailSend', $this->settings[$model->alias]); if ($sendTimes === null) { $sendTimes[] = $model->MailQueue->getSaveSendTime(); @@ -681,7 +685,9 @@ public function saveQueuePostMail(Model $model, $languageId, $sendTimes = null, // ルーム配信で送るパーミッション /** @see MailQueueUser::getSendRoomPermission() */ - $sendRoomPermission = $model->MailQueueUser->getSendRoomPermission($typeKey); + if (! isset($sendRoomPermission)) { + $sendRoomPermission = $model->MailQueueUser->getSendRoomPermission($typeKey); + } // ルーム配信 /** @see MailQueueUser::addMailQueueUserInRoom() */