12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- defined('GNUSOCIAL') || die();
- class MirrorQueueHandler extends QueueHandler
- {
- function transport()
- {
- return 'mirror';
- }
- function handle($notice) : bool
- {
- if (!($notice instanceof Notice)) {
- common_log(LOG_ERR, "Got a bogus notice, not mirroring");
- return true;
- }
- $mirror = new SubMirror();
- $mirror->subscribed = $notice->profile_id;
- if ($mirror->find()) {
- while ($mirror->fetch()) {
- try {
- $mirror->mirrorNotice($notice);
- } catch (Exception $e) {
- common_log(LOG_ERR, "Exception trying to mirror notice $notice->id " .
- "for subscriber $mirror->subscriber ($mirror->style): " .
- $e->getMessage());
- }
- }
- }
- return true;
- }
- }
|