3 namespace dokuwiki\Subscriptions
;
5 class MediaSubscriptionSender
extends SubscriptionSender
8 * Send the diff for some media change
10 * @fixme this should embed thumbnails of images in HTML version
12 * @param string $subscriber_mail The target mail address
13 * @param string $template Mail template ('uploadmail', ...)
14 * @param string $id Media file for which the notification is
15 * @param int|bool $rev Old revision if any
16 * @param int|bool $current_rev New revision if any
18 public function sendMediaDiff($subscriber_mail, $template, $id, $rev = false, $current_rev = false)
23 [$mime, /* ext */] = mimetype($id);
27 'MEDIA' => ml($id, $current_rev ?
('rev=' . $current_rev) : '', true, '&', true),
28 'SIZE' => filesize_h(filesize($file)),
31 if ($rev && $conf['mediarevisions']) {
32 $trep['OLD'] = ml($id, "rev=$rev", true, '&', true);
37 $headers = ['Message-Id' => $this->getMessageID($id, @filemtime
($file))];
39 $headers['In-Reply-To'] = $this->getMessageID($id, $rev);
42 $this->send($subscriber_mail, 'upload', $id, $template, $trep, null, $headers);