]> git.wh0rd.org - tt-rss.git/commitdiff
add HOOK_UNSUBSCRIBE_FEED
authordim0x69 <github@dsmail.org>
Mon, 27 Nov 2017 10:46:46 +0000 (11:46 +0100)
committerdim0x69 <github@dsmail.org>
Mon, 27 Nov 2017 10:46:46 +0000 (11:46 +0100)
classes/pluginhost.php
classes/pref/feeds.php

index 533e7ee911f59872b518dcb62d039d0acf911a3e..f56343c5f34615794ba27dd61087d80b4a95e351 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;
index a86a1af94b369a81b05faa9b54db8b83d18faa16..fcbc0f8cdab00efab2845bb7d3afc9e116b1edf6 100755 (executable)
@@ -1740,6 +1740,10 @@ class Pref_Feeds extends Handler_Protected {
 
        static function remove_feed($id, $owner_uid) {
 
+               foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_UNSUBSCRIBE_FEED) as $p) {
+                       $line = $p->hook_unsubscribe_feed($id, $owner_uid);
+               }
+
                if ($id > 0) {
 
                        /* save starred articles in Archived feed */
@@ -1969,4 +1973,4 @@ class Pref_Feeds extends Handler_Protected {
                return $url_path;
        }
 
-}
\ No newline at end of file
+}