29 lines
636 B
PHP
29 lines
636 B
PHP
<?php
|
|
/*
|
|
* Name: [beta] PM triggers
|
|
* Author: Shish <webmaster@shishnet.org>
|
|
* License: GPLv2
|
|
* Description: Send PMs in response to certain events (eg image deletion)
|
|
*/
|
|
|
|
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~ (#{$image->id}, {$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
|
|
)));
|
|
}
|
|
}
|
|
?>
|