[pm_triggers] remove ext that never went anywhere
This commit is contained in:
parent
cff163591c
commit
9d205ad2d0
2 changed files with 0 additions and 47 deletions
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shimmie2;
|
||||
|
||||
class PMTriggerInfo extends ExtensionInfo
|
||||
{
|
||||
public const KEY = "pm_triggers";
|
||||
|
||||
public string $key = self::KEY;
|
||||
public string $name = "PM triggers";
|
||||
public string $url = self::SHIMMIE_URL;
|
||||
public array $authors = self::SHISH_AUTHOR;
|
||||
public string $license = self::LICENSE_GPLV2;
|
||||
public string $description = "Send PMs in response to certain events (eg post deletion)";
|
||||
public bool $beta = true;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shimmie2;
|
||||
|
||||
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
|
||||
)));
|
||||
}
|
||||
}
|
Reference in a new issue