]> git.wh0rd.org - tt-rss.git/commitdiff
Merge branch 'master' of git.tt-rss.org:git/tt-rss into pdo-experimental
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 11 Dec 2017 09:54:30 +0000 (12:54 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 11 Dec 2017 09:54:30 +0000 (12:54 +0300)
classes/pluginhost.php
classes/pref/feeds.php [changed mode: 0755->0644]

index f9d5bc29aa7c36945c85a0e8c098ad28abc1d94f..4224893c24163fd1624bd18c98686bb903d2ec5e 100644 (file)
@@ -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;
old mode 100755 (executable)
new mode 100644 (file)
index 0b5a445..846e814
@@ -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
+}