various changes, fixes to css etc
This commit is contained in:
@@ -142,6 +142,7 @@ class VideoController extends Controller
|
||||
$video->tag($video->category->name);
|
||||
|
||||
// TODO: outsource to different process (async)
|
||||
// sirx: Why? since the cpu clocks at more than 800mhz its fast, thinking of the 100mb filesize limit, it wont take long to create a thumbnail
|
||||
$video->createThumbnail();
|
||||
$video->tesThumb();
|
||||
|
||||
@@ -163,6 +164,25 @@ class VideoController extends Controller
|
||||
exec("curl -H \"Content-Type: application/json; charset=UTF-8\" -X POST -d '$payload' '$url' > /dev/null &");
|
||||
}
|
||||
|
||||
if (config('matrix.enabled') && config('matrix.roomid')) {
|
||||
$nsfw = in_array('nsfw', $video->getTagArrayNormalizedAttribute());
|
||||
$nsfw = $nsfw ? ' :exclamation: **NSFW** :exclamation:' : '';
|
||||
$message = config('matrix.message');
|
||||
$message = str_replace(
|
||||
['<USER>', '<ID>', '<NSFW>'],
|
||||
[$user->username, $video->id, $nsfw],
|
||||
$message
|
||||
);
|
||||
$room = "DBWMqijxlNIUIjBNdM:f0ck.it";
|
||||
$url = "https://f0ck.it/_matrix/client/r0/rooms/%21DBWMqijxlNIUIjBNdM:f0ck.it/send/m.room.message?access_token=syt_bml4Yw_yIqaTxnQHQBzeYnHusNi_3Th9Pn";
|
||||
|
||||
$payload = json_encode([
|
||||
'content' => $message,
|
||||
]);
|
||||
|
||||
exec("curl -X POST -d '{ 'msgtype : m.text', 'body: $payload'}' '$url' > /dev/null &");
|
||||
}
|
||||
|
||||
return new JsonResponse([
|
||||
'error' => 'null',
|
||||
'video_id' => $video->id
|
||||
|
Reference in New Issue
Block a user