]> git.wh0rd.org - tt-rss.git/commitdiff
implement stop action
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 31 Mar 2013 15:28:36 +0000 (19:28 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 31 Mar 2013 15:28:36 +0000 (19:28 +0400)
include/functions.php
include/rssfuncs.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
schema/versions/mysql/113.sql [new file with mode: 0644]
schema/versions/pgsql/113.sql [new file with mode: 0644]

index 9f75fc23aeb7e9f81b755b0429402ef04e5da448..9a52981e6aeafce9374706e1b4d802ed9a183e59 100644 (file)
@@ -1,6 +1,6 @@
 <?php
        define('EXPECTED_CONFIG_VERSION', 26);
-       define('SCHEMA_VERSION', 112);
+       define('SCHEMA_VERSION', 113);
 
        define('LABEL_BASE_INDEX', -1024);
        define('PLUGIN_FEED_BASE_INDEX', -128);
index 3bce14d33ab8786bd3b67bb8b7aa6a0a94fbbef8..e3b1e44b21649040b3a9bdb0e5cf4bc1eb888a1c 100644 (file)
                                        _debug("update_rss_feed: fetching [$fetch_url] (ts: $cache_timestamp/$last_updated_timestamp)");
                                }
 
+                               $force_refetch = isset($_REQUEST["force_refetch"]);
+
                                $feed_data = fetch_file_contents($fetch_url, false,
                                        $auth_login, $auth_pass, false, $no_cache ? 15 : 45,
-                                       max($last_updated_timestamp, $cache_timestamp));
+                                       $force_refetch ? 0 : max($last_updated_timestamp, $cache_timestamp));
 
                                if ($debug_enabled) {
                                        _debug("update_rss_feed: fetch done.");
                        if ($filter_match) {
                                foreach ($filter["actions"] AS $action) {
                                        array_push($matches, $action);
+
+                                       // if Stop action encountered, perform no further processing
+                                       if ($action["type"] == "stop") return $matches;
                                }
                        }
                }
index 40d5c67f576f9fabbc2428227ec70854cec1b796..9e1725f33d49290f31d9e2c923af398f03dc5b45 100644 (file)
@@ -246,6 +246,9 @@ insert into ttrss_filter_actions (id,name,description) values (6, 'score',
 insert into ttrss_filter_actions (id,name,description) values (7, 'label',
        'Assign label');
 
+insert into ttrss_filter_actions (id,name,description) values (8, 'stop',
+       'Stop / Do nothing');
+
 create table ttrss_filters2(id integer primary key auto_increment,
        owner_uid integer not null,
        match_any_rule boolean not null default false,
@@ -293,7 +296,7 @@ create table ttrss_tags (id integer primary key auto_increment,
 
 create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
 
-insert into ttrss_version values (112);
+insert into ttrss_version values (113);
 
 create table ttrss_enclosures (id integer primary key auto_increment,
        content_url text not null,
index 711a35968ebc6976f6f6f47338f5fc78cef38954..c977cf0bffe10108e4cb152c2c99a76a6db84ada 100644 (file)
@@ -219,6 +219,9 @@ insert into ttrss_filter_actions (id,name,description) values (6, 'score',
 insert into ttrss_filter_actions (id,name,description) values (7, 'label',
        'Assign label');
 
+insert into ttrss_filter_actions (id,name,description) values (8, 'stop',
+       'Stop / Do nothing');
+
 create table ttrss_filters2(id serial not null primary key,
        owner_uid integer not null references ttrss_users(id) on delete cascade,
        match_any_rule boolean not null default false,
@@ -251,7 +254,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id);
 
 create table ttrss_version (schema_version int not null);
 
-insert into ttrss_version values (112);
+insert into ttrss_version values (113);
 
 create table ttrss_enclosures (id serial not null primary key,
        content_url text not null,
diff --git a/schema/versions/mysql/113.sql b/schema/versions/mysql/113.sql
new file mode 100644 (file)
index 0000000..3c0d005
--- /dev/null
@@ -0,0 +1,8 @@
+begin;
+
+insert into ttrss_filter_actions (id,name,description) values (8, 'stop',
+       'Stop / Do nothing');
+
+update ttrss_version set schema_version = 113;
+
+commit;
diff --git a/schema/versions/pgsql/113.sql b/schema/versions/pgsql/113.sql
new file mode 100644 (file)
index 0000000..3c0d005
--- /dev/null
@@ -0,0 +1,8 @@
+begin;
+
+insert into ttrss_filter_actions (id,name,description) values (8, 'stop',
+       'Stop / Do nothing');
+
+update ttrss_version set schema_version = 113;
+
+commit;