From 0512151eabf64e88b4648869b3d029800d30668a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 1 Mar 2010 18:19:20 -0500 Subject: [PATCH] more output in updateostatus.php --- plugins/OStatus/scripts/updateostatus.php | 29 +++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/plugins/OStatus/scripts/updateostatus.php b/plugins/OStatus/scripts/updateostatus.php index 1414f81e93..d553a7d625 100644 --- a/plugins/OStatus/scripts/updateostatus.php +++ b/plugins/OStatus/scripts/updateostatus.php @@ -24,7 +24,7 @@ $shortoptions = 'i:n:a'; $longoptions = array('id=', 'nickname=', 'all'); $helptext = <<nickname}..."; + } + $up = $user->getProfile(); $sp = $user->getSubscriptions(); @@ -84,16 +88,37 @@ function updateOStatus($user) } } + if (!have_option('q', 'quiet')) { + echo count($rps) . "\n"; + } + foreach ($rps as $rp) { try { + if (!have_option('q', 'quiet')) { + echo "Checking {$rp->nickname}..."; + } + $op = Ostatus_profile::ensureProfile($rp->profileurl); - if (!empty($op)) { + if (empty($op)) { + echo "can't convert.\n"; + continue; + } else { + if (!have_option('q', 'quiet')) { + echo "Converting..."; + } Subscription::cancel($up, $rp); Subscription::start($up, $op->localProfile()); + if (!have_option('q', 'quiet')) { + echo "done.\n"; + } } } catch (Exception $e) { + if (!have_option('q', 'quiet')) { + echo "fail.\n"; + } + continue; common_log(LOG_WARNING, "Couldn't convert OMB subscription (" . $up->nickname . ", " . $rp->nickname . ") to OStatus: " . $e->getMessage()); continue; -- 2.39.5