From 07bc80286767b322fab247b5b4e9f77f67a770fb Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 16 Feb 2011 11:58:35 -0500 Subject: [PATCH] argument to send email summary to all users on all sites --- plugins/EmailSummary/sendemailsummary.php | 35 +++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/plugins/EmailSummary/sendemailsummary.php b/plugins/EmailSummary/sendemailsummary.php index d3773b74c0..aad79c7360 100644 --- a/plugins/EmailSummary/sendemailsummary.php +++ b/plugins/EmailSummary/sendemailsummary.php @@ -20,8 +20,8 @@ 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'); + } } - -- 2.39.5