X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdistribqueuehandler.php;h=036d970f2af9c3be343ffa36d350265b690895ac;hb=628e7fa583df4211fdf5490be5e3b651604f1137;hp=4a671fe802d9f81c2911d4500f575e8024088bb0;hpb=2272cc244d04ff974cb3ef23538a6fc7a1cee277;p=quix0rs-gnu-social.git diff --git a/lib/distribqueuehandler.php b/lib/distribqueuehandler.php index 4a671fe802..036d970f2a 100644 --- a/lib/distribqueuehandler.php +++ b/lib/distribqueuehandler.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); } /** * Base class for queue handlers. @@ -43,7 +43,7 @@ class DistribQueueHandler * @return string */ - function transport() + public function transport() { return 'distrib'; } @@ -61,8 +61,22 @@ class DistribQueueHandler * @param Notice $notice * @return boolean true on success, false on failure */ - function handle($notice) + public function handle(Notice $notice) { + // We have to manually add attentions to non-profile subs and non-mentions + $ptAtts = $notice->getAttentionsFromProfileTags(); + foreach (array_keys($ptAtts) as $profile_id) { + $profile = Profile::getKV('id', $profile_id); + if ($profile instanceof Profile) { + try { + common_debug('Adding Attention for '.$notice->getID().' profile '.$profile->getID()); + Attention::saveNew($notice, $profile); + } catch (Exception $e) { + $this->logit($notice, $e); + } + } + } + try { $notice->sendReplyNotifications(); } catch (Exception $e) {