mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-24 21:40:47 +00:00
This commit is contained in:
parent
9d31f73bfa
commit
2c20d9e398
2 changed files with 37 additions and 17 deletions
|
@ -28,7 +28,24 @@ class Status extends Model
|
|||
*/
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $fillable = ['profile_id', 'visibility', 'in_reply_to_id', 'reblog_of_id', 'type'];
|
||||
protected $fillable = [
|
||||
'scope',
|
||||
'caption',
|
||||
'rendered',
|
||||
'url',
|
||||
'uri',
|
||||
'object_url',
|
||||
'created_at',
|
||||
'local',
|
||||
'is_nsfw',
|
||||
'scope',
|
||||
'cw_summary',
|
||||
'profile_id',
|
||||
'visibility',
|
||||
'in_reply_to_id',
|
||||
'reblog_of_id',
|
||||
'type'
|
||||
];
|
||||
|
||||
const STATUS_TYPES = [
|
||||
'text',
|
||||
|
|
|
@ -474,22 +474,25 @@ class Helpers {
|
|||
return;
|
||||
}
|
||||
|
||||
$status = new Status;
|
||||
$status->profile_id = $pid;
|
||||
$status->url = $url;
|
||||
$status->uri = $url;
|
||||
$status->object_url = $id;
|
||||
$status->caption = strip_tags($activity['content']);
|
||||
$status->rendered = Purify::clean($activity['content']);
|
||||
$status->created_at = Carbon::parse($ts)->tz('UTC');
|
||||
$status->in_reply_to_id = $reply_to;
|
||||
$status->local = false;
|
||||
$status->is_nsfw = $cw;
|
||||
$status->scope = $scope;
|
||||
$status->visibility = $scope;
|
||||
$status->cw_summary = $cw == true && isset($activity['summary']) ?
|
||||
Purify::clean(strip_tags($activity['summary'])) : null;
|
||||
$status->save();
|
||||
$status = Status::updateOrCreate(
|
||||
[
|
||||
'uri' => $url
|
||||
], [
|
||||
'profile_id' => $pid,
|
||||
'url' => $url,
|
||||
'object_url' => $id,
|
||||
'caption' => strip_tags($activity['content']),
|
||||
'rendered' => Purify::clean($activity['content']),
|
||||
'created_at' => Carbon::parse($ts)->tz('UTC'),
|
||||
'in_reply_to_id' => $reply_to,
|
||||
'local' => false,
|
||||
'is_nsfw' => $cw,
|
||||
'scope' => $scope,
|
||||
'visibility' => $scope,
|
||||
'cw_summary' => ($cw == true && isset($activity['summary']) ?
|
||||
Purify::clean(strip_tags($activity['summary'])) : null)
|
||||
]
|
||||
);
|
||||
|
||||
if($reply_to == null) {
|
||||
self::importNoteAttachment($activity, $status);
|
||||
|
|
Loading…
Reference in a new issue