ensureFeedURL will return Ostatus_profile early if already stored

This commit is contained in:
Mikael Nordfeldth 2015-02-20 14:47:12 +01:00
parent 96099807e1
commit c1e3cfe7a7
1 changed files with 5 additions and 0 deletions

View File

@ -1120,6 +1120,11 @@ class Ostatus_profile extends Managed_DataObject
*/
public static function ensureFeedURL($feed_url, array $hints=array())
{
$oprofile = Ostatus_profile::getKV('feeduri', $feed_url);
if ($oprofile instanceof Ostatus_profile) {
return $oprofile;
}
$discover = new FeedDiscovery();
$feeduri = $discover->discoverFromFeedURL($feed_url);