summaryrefslogtreecommitdiff
path: root/classes/pref/feeds.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-01-17 14:55:11 +0300
committerAndrew Dolgov <[email protected]>2021-01-17 14:55:11 +0300
commitda0ad82c2497ed34cb29cf78e29c75a4d4ffb8bd (patch)
tree12f9b19df9a31766585e39e54d8d860f2dec3692 /classes/pref/feeds.php
parent6c1344908862e344a1108e92ec19368402cfd9d1 (diff)
Archive cleanup:
- remove code to manually archive/unarchive articles - remove ttrss_archived_feeds/orig_feed_id handling - the whole thing was implemented for this data to be kept indefinitely; it doesn't make a lot of sense to deal with this stuff now that it is expired after one month anyway (same reasons as feed browser being removed - privacy) - remove "originally from"-related stuff because of the above - also remove unused remaining frontend/backend code related to feed browser (rip)
Diffstat (limited to 'classes/pref/feeds.php')
-rwxr-xr-xclasses/pref/feeds.php53
1 files changed, 11 insertions, 42 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index e1e88ddc0..88c5b7f0e 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -1607,54 +1607,23 @@ class Pref_Feeds extends Handler_Protected {
/* save starred articles in Archived feed */
- /* prepare feed if necessary */
+ $sth = $pdo->prepare("UPDATE ttrss_user_entries SET
+ feed_id = NULL, orig_feed_id = NULL
+ WHERE feed_id = ? AND marked = true AND owner_uid = ?");
- $sth = $pdo->prepare("SELECT feed_url FROM ttrss_feeds WHERE id = ?
- AND owner_uid = ?");
$sth->execute([$id, $owner_uid]);
- if ($row = $sth->fetch()) {
- $feed_url = $row["feed_url"];
+ /* Remove access key for the feed */
- $sth = $pdo->prepare("SELECT id FROM ttrss_archived_feeds
- WHERE feed_url = ? AND owner_uid = ?");
- $sth->execute([$feed_url, $owner_uid]);
-
- if ($row = $sth->fetch()) {
- $archive_id = $row["id"];
- } else {
- $res = $pdo->query("SELECT MAX(id) AS id FROM ttrss_archived_feeds");
- $row = $res->fetch();
-
- $new_feed_id = (int)$row['id'] + 1;
-
- $sth = $pdo->prepare("INSERT INTO ttrss_archived_feeds
- (id, owner_uid, title, feed_url, site_url, created)
- SELECT ?, owner_uid, title, feed_url, site_url, NOW() from ttrss_feeds
- WHERE id = ?");
- $sth->execute([$new_feed_id, $id]);
-
- $archive_id = $new_feed_id;
- }
-
- $sth = $pdo->prepare("UPDATE ttrss_user_entries SET feed_id = NULL,
- orig_feed_id = ? WHERE feed_id = ? AND
- marked = true AND owner_uid = ?");
-
- $sth->execute([$archive_id, $id, $owner_uid]);
-
- /* Remove access key for the feed */
-
- $sth = $pdo->prepare("DELETE FROM ttrss_access_keys WHERE
- feed_id = ? AND owner_uid = ?");
- $sth->execute([$id, $owner_uid]);
+ $sth = $pdo->prepare("DELETE FROM ttrss_access_keys WHERE
+ feed_id = ? AND owner_uid = ?");
+ $sth->execute([$id, $owner_uid]);
- /* remove the feed */
+ /* remove the feed */
- $sth = $pdo->prepare("DELETE FROM ttrss_feeds
- WHERE id = ? AND owner_uid = ?");
- $sth->execute([$id, $owner_uid]);
- }
+ $sth = $pdo->prepare("DELETE FROM ttrss_feeds
+ WHERE id = ? AND owner_uid = ?");
+ $sth->execute([$id, $owner_uid]);
$pdo->commit();