* Finish task#7346.

This commit is contained in:
leiyong
2020-07-14 01:59:30 -07:00
parent e5550081e6
commit cdcd17b0fe
3 changed files with 22 additions and 4 deletions
+7 -3
View File
@@ -87,10 +87,14 @@ class webhookModel extends model
}
$text = '';
if(isset($data->markdown) and is_object($data->markdown))
if(isset($data->markdown->text))
{
$text = substr($data->markdown->text, 0, strpos($data->markdown->text, '(http'));
}
elseif(isset($data->markdown->content))
{
$text = substr($data->markdown->content, 0, strpos($data->markdown->content, '(http'));
}
else
{
$text = substr($data->text, 0, strpos($data->text, '(http')) ? substr($data->text, 0, strpos($data->text, '(http')) : zget($users, $data->user, $this->app->user->realname) . $this->lang->action->label->{$action->action} . $this->lang->action->objectTypes[$action->objectType] . "[#{$action->objectID}::{$object->$field}]";
@@ -321,9 +325,9 @@ class webhookModel extends model
$this->saveData($id, $actionID, $postData, $actor);
continue;
}
$result = $this->fetchHook($webhook, $postData, $actionID);
$this->saveLog($webhook, $actionID, $postData, $result);
if(!empty($result)) $this->saveLog($webhook, $actionID, $postData, $result);
}
return !dao::isError();
}