[pm_triggers] remove ext that never went anywhere

This commit is contained in:
Shish 2024-01-06 21:22:01 +00:00
parent cff163591c
commit 9d205ad2d0
2 changed files with 0 additions and 47 deletions

View file

@ -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;
}

View file

@ -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
)));
}
}