From d31c104de2b53415a181ddccd16011587ca7cf26 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 13 Jan 2023 03:28:34 +0000 Subject: [PATCH] * Resolve feedback#1954 --- module/message/model.php | 12 ++++++++++-- module/webhook/model.php | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/module/message/model.php b/module/message/model.php index f0191d4173..d9a2a8c564 100755 --- a/module/message/model.php +++ b/module/message/model.php @@ -144,7 +144,7 @@ class messageModel extends model $table = $this->config->objectTables[$objectType]; $field = $this->config->action->objectNameFields[$objectType]; $object = $this->dao->select('*')->from($table)->where('id')->eq($objectID)->fetch(); - $toList = $this->getToList($object, $objectType); + $toList = $this->getToList($object, $objectType, $actionID); if(empty($toList)) return false; if($toList == $actor) return false; @@ -181,10 +181,11 @@ class messageModel extends model * * @param object $object * @param string $objectType + * @param int $actionID * @access public * @return string */ - public function getToList($object, $objectType) + public function getToList($object, $objectType, $actionID = 0) { $toList = ''; if(!empty($object->assignedTo)) $toList = $object->assignedTo; @@ -211,6 +212,13 @@ class messageModel extends model if($toList == 'closed') $toList = ''; if($objectType == 'feedback' and $object->status == 'replied') $toList = ',' . $object->openedBy . ','; + if($objectType == 'story' and $actionID) + { + $action = $this->loadModel('action')->getById($actionID); + list($toList, $ccList) = $this->loadModel($objectType)->getToAndCcList($object, $action->action); + $toList = $toList . $ccList; + } + return $toList; } diff --git a/module/webhook/model.php b/module/webhook/model.php index 8999a62d6f..19c32e8429 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -627,7 +627,7 @@ class webhookModel extends model if(empty($table)) return false; $object = $this->dao->select('*')->from($table)->where('id')->eq($action->objectID)->fetch(); - $toList = $this->loadModel('message')->getToList($object, $action->objectType); + $toList = $this->loadModel('message')->getToList($object, $action->objectType, $actionID); if(!empty($object->mailto)) $toList .= ',' . $object->mailto; if(empty($toList)) return false;