X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FEmailSummary%2Fsendemailsummary.php;h=aad79c736046e05fcd43d390afeec24191913e5e;hb=fc62a8f980bc8706b5aea13bc0be24837d027043;hp=37bfdcfbd11519011e77919f6341d1f0ae27b3f4;hpb=407663fb402f0384cced2b63a2f901d19ab71d19;p=quix0rs-gnu-social.git diff --git a/plugins/EmailSummary/sendemailsummary.php b/plugins/EmailSummary/sendemailsummary.php index 37bfdcfbd1..aad79c7360 100644 --- a/plugins/EmailSummary/sendemailsummary.php +++ b/plugins/EmailSummary/sendemailsummary.php @@ -1,47 +1,59 @@ #!/usr/bin/env php -. - */ + . + */ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..')); -$shortoptions = 'i:n:a'; -$longoptions = array('id=', 'nickname=', 'all'); +$shortoptions = 'i:n:au'; +$longoptions = array('id=', 'nickname=', 'all', 'universe'); $helptext = <<enqueue($user->id, 'usersum'); -} catch (NoUserArgumentException $nuae) { - $qm->enqueue(null, 'sitesum'); +if (have_option('u', 'universe')) { + $sn = new Status_network(); + if ($sn->find()) { + while ($sn->fetch()) { + $server = $sn->getServerName(); + StatusNet::init($server); + // Different queue manager, maybe! + $qm = QueueManager::get(); + $qm->enqueue(null, 'sitesum'); + } + } +} else { + $qm = QueueManager::get(); + // enqueue summary for user or all users + try { + $user = getUser(); + $qm->enqueue($user->id, 'usersum'); + } catch (NoUserArgumentException $nuae) { + $qm->enqueue(null, 'sitesum'); + } }