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