forked from GNUsocial/gnu-social
getLeaseRemaining for FeedSub too
This commit is contained in:
parent
377947c57f
commit
8ab98b72ac
@ -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
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user