From: wltb Date: Sat, 17 May 2014 15:51:35 +0000 (+0200) Subject: Add subscribe hook, give more information to fetch_feed hook X-Git-Tag: 1.13~32^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=01465325b48270e5eee5db94c6178ba6d567ddf7;p=tt-rss.git Add subscribe hook, give more information to fetch_feed hook --- diff --git a/classes/pluginhost.php b/classes/pluginhost.php index bd6afa81..744337e0 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -41,6 +41,7 @@ class PluginHost { const HOOK_HOUSE_KEEPING = 24; const HOOK_SEARCH = 25; const HOOK_FORMAT_ENCLOSURES = 26; + const HOOK_SUBSCRIBE_FEED = 27; const KIND_ALL = 1; const KIND_SYSTEM = 2; diff --git a/include/functions.php b/include/functions.php index 01d8d47f..2e76f157 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1687,6 +1687,10 @@ return array("code" => 5, "message" => $fetch_last_error); } + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) { + $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass); + } + if (is_html($contents)) { $feedUrls = get_feeds_from_html($url, $contents); diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 15f1df0c..010071e5 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -268,7 +268,7 @@ $force_refetch = isset($_REQUEST["force_refetch"]); foreach ($pluginhost->get_hooks(PluginHost::HOOK_FETCH_FEED) as $plugin) { - $feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed); + $feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $last_article_timestamp, $auth_login, $auth_pass); } // try cache