From: Andrew Dolgov Date: Mon, 11 Dec 2017 09:54:30 +0000 (+0300) Subject: Merge branch 'master' of git.tt-rss.org:git/tt-rss into pdo-experimental X-Git-Tag: 18.8~119 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=f70d456a5bc509e56991195a2f003cf2714d0e13;hp=930691876762e8149724993e2de7a80648442615 Merge branch 'master' of git.tt-rss.org:git/tt-rss into pdo-experimental --- diff --git a/classes/pluginhost.php b/classes/pluginhost.php index f9d5bc29..4224893c 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -56,6 +56,7 @@ class PluginHost { const HOOK_FORMAT_ARTICLE_CDM = 35; const HOOK_FEED_BASIC_INFO = 36; const HOOK_SEND_LOCAL_FILE = 37; + const HOOK_UNSUBSCRIBE_FEED = 38; const KIND_ALL = 1; const KIND_SYSTEM = 2; diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php old mode 100755 new mode 100644 index 0b5a445f..846e814e --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1554,6 +1554,14 @@ class Pref_Feeds extends Handler_Protected { } static function remove_feed($id, $owner_uid) { + $debug = isset($_REQUEST["debug"]); + + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_UNSUBSCRIBE_FEED) as $p) { + if( ! $p->hook_unsubscribe_feed($id, $owner_uid)){ + if($debug) _debug("Feed not removed due to Error in Plugin. (HOOK_UNSUBSCRIBE_FEED)"); + return; + } + } $pdo = Db::pdo(); @@ -1780,4 +1788,4 @@ class Pref_Feeds extends Handler_Protected { return $url_path; } -} \ No newline at end of file +}