From: Mikael Nordfeldth Date: Wed, 13 Jan 2016 19:01:00 +0000 (+0100) Subject: getLeaseRemaining for FeedSub too X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8ab98b72ac506f559cdc66b1a6689dcba1b18b00;p=quix0rs-gnu-social.git getLeaseRemaining for FeedSub too --- diff --git a/plugins/OStatus/classes/FeedSub.php b/plugins/OStatus/classes/FeedSub.php index ad2c4ed684..72746e9b90 100644 --- a/plugins/OStatus/classes/FeedSub.php +++ b/plugins/OStatus/classes/FeedSub.php @@ -108,6 +108,14 @@ class FeedSub extends Managed_DataObject return $this->uri; } + function getLeaseRemaining() + { + if (empty($this->sub_end)) { + return null; + } + return strtotime($this->sub_end) - time(); + } + /** * Do we have a hub? Then we are a PuSH feed. * https://en.wikipedia.org/wiki/PubSubHubbub diff --git a/plugins/OStatus/scripts/resub-feed.php b/plugins/OStatus/scripts/resub-feed.php index d5d0924fbf..37b09883db 100755 --- a/plugins/OStatus/scripts/resub-feed.php +++ b/plugins/OStatus/scripts/resub-feed.php @@ -81,6 +81,8 @@ function showSub($sub) print " Verify token: $sub->verify_token\n"; print " Signature secret: $sub->secret\n"; print " Sub start date: $sub->sub_start\n"; + print " Sub end date: $sub->sub_end\n"; + print " Sub lease remaining: {$sub->getLeaseRemaining()}\n"; print " Record created: $sub->created\n"; print " Record modified: $sub->modified\n"; }