OStatus plugin - Merge some bug fixes by XRevan86

This commit is contained in:
Diogo Cordeiro 2019-04-20 23:27:46 +01:00
parent 25eb06ac46
commit 7b6c887d76
2 changed files with 6 additions and 4 deletions

View File

@ -78,7 +78,6 @@ showSub($sub2);
function showSub($sub) function showSub($sub)
{ {
print " Subscription state: $sub->sub_state\n"; print " Subscription state: $sub->sub_state\n";
print " Verify token: $sub->verify_token\n";
print " Signature secret: $sub->secret\n"; print " Signature secret: $sub->secret\n";
print " Sub start date: $sub->sub_start\n"; print " Sub start date: $sub->sub_start\n";
print " Sub end date: $sub->sub_end\n"; print " Sub end date: $sub->sub_end\n";

View File

@ -74,10 +74,14 @@ try {
$xrd = $disco->lookup($acct); $xrd = $disco->lookup($acct);
$hints = DiscoveryHints::fromXRD($xrd); $hints = DiscoveryHints::fromXRD($xrd);
if (empty($feedurl) && !array_key_exists('feedurl', $hints)) { if (array_key_exists('feedurl', $hints)) {
// Prefer $hints['feedurl'] to current $feedurl value
$feedurl = $hints['feedurl'];
} elseif (empty($feedurl)) {
// if (empty($feedurl) && !array_key_exists('feedurl', $hints))
throw new FeedSubNoFeedException($acct); throw new FeedSubNoFeedException($acct);
} }
$feedurl = $feedurl ?: $hints['feedurl'];
$salmonuri = array_key_exists('salmon', $hints) ? $hints['salmon'] : $salmonuri; $salmonuri = array_key_exists('salmon', $hints) ? $hints['salmon'] : $salmonuri;
// get the hub data too and put it in the FeedDiscovery object // get the hub data too and put it in the FeedDiscovery object
@ -166,7 +170,6 @@ function showProfile($oprofile)
function showSub($sub) function showSub($sub)
{ {
print " Subscription state: $sub->sub_state\n"; print " Subscription state: $sub->sub_state\n";
print " Verify token: $sub->verify_token\n";
print " Signature secret: $sub->secret\n"; print " Signature secret: $sub->secret\n";
print " Sub start date: $sub->sub_start\n"; print " Sub start date: $sub->sub_start\n";
print " Record created: $sub->created\n"; print " Record created: $sub->created\n";