This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/pm_triggers/main.php

26 lines
624 B
PHP
Raw Normal View History

2020-01-26 13:19:35 +00:00
<?php declare(strict_types=1);
2013-04-26 16:27:22 +00:00
class PMTrigger extends Extension
{
public function onImageDeletion(ImageDeletionEvent $event)
{
$this->send(
$event->image->owner_id,
"[System] An image you uploaded has been deleted",
"Image le gone~ (#{$event->image->id}, {$event->image->get_tag_list()})"
);
}
2013-04-26 16:27:22 +00:00
private function send($to_id, $subject, $body)
{
global $user;
send_event(new SendPMEvent(new PM(
$user->id,
$_SERVER["REMOTE_ADDR"],
$to_id,
$subject,
$body
)));
}
2013-04-26 16:27:22 +00:00
}