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
2019-08-07 15:40:01 -05:00

25 lines
599 B
PHP

<?php
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()})"
);
}
private function send($to_id, $subject, $body)
{
global $user;
send_event(new SendPMEvent(new PM(
$user->id,
$_SERVER["REMOTE_ADDR"],
$to_id,
$subject,
$body
)));
}
}