f15407bc75
X-Real-IP for core functionality Global config define REVERSE_PROXY_X_HEADERS Config host and port for varnish PURGE config option to specify PURGE protocol exception in curl purge now shows error code ipv6 x-real-ip addresses are now validated properly X-Forwarded-Proto enabled by define
27 lines
612 B
PHP
27 lines
612 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
class PMTrigger extends Extension
|
|
{
|
|
public function onImageDeletion(ImageDeletionEvent $event)
|
|
{
|
|
$this->send(
|
|
$event->image->owner_id,
|
|
"[System] A post you uploaded has been deleted",
|
|
"Post le gone~ (#{$event->image->id}, {$event->image->get_tag_list()})"
|
|
);
|
|
}
|
|
|
|
private function send($to_id, $subject, $body)
|
|
{
|
|
global $user;
|
|
send_event(new SendPMEvent(new PM(
|
|
$user->id,
|
|
get_real_ip(),
|
|
$to_id,
|
|
$subject,
|
|
$body
|
|
)));
|
|
}
|
|
}
|