X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2Fscripts%2Fresub-feed.php;h=a08d837993df35e3746c60cd670bc86213d0bc5c;hb=641018e95051b029dcd57a4eb304ee545230136a;hp=121d12109a1f1fb380d2085e257f2440180a2633;hpb=fd9d520aeb52f7f3a3fe7c242fbe16078de1bc6e;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/scripts/resub-feed.php b/plugins/OStatus/scripts/resub-feed.php index 121d12109a..a08d837993 100644 --- a/plugins/OStatus/scripts/resub-feed.php +++ b/plugins/OStatus/scripts/resub-feed.php @@ -20,11 +20,17 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); +$longoptions = array('unsub'); +$shortoptions = 'u'; + $helptext = <<huburi with new subscription for $sub->uri\n"; -$ok = $sub->subscribe(); + +if (have_option('u') || have_option('--unsub')) { + print "Pinging hub $sub->huburi with unsubscription for $sub->uri\n"; + $ok = $sub->unsubscribe(); +} else { + print "Pinging hub $sub->huburi with new subscription for $sub->uri\n"; + $ok = $sub->subscribe(); +} if ($ok) { print "ok\n"; @@ -57,7 +69,7 @@ if ($ok) { print "Could not confirm.\n"; } -$sub2 = FeedSub::staticGet('topic', $feedurl); +$sub2 = FeedSub::staticGet('uri', $feedurl); print "\n"; print "New state:\n";