aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Channel_purge.php
diff options
context:
space:
mode:
authormjfriaza <mjfriaza@disroot.org>2022-05-17 13:44:06 +0200
committermjfriaza <mjfriaza@disroot.org>2022-05-17 13:44:06 +0200
commita75c61d71efebf43713026200aa0f513bd7eef09 (patch)
tree909048adeaa329813e2530d43626ed3bd711bc25 /Zotlabs/Daemon/Channel_purge.php
parent481ecee9e87342ca7a1217395085e95d1a3b61ea (diff)
parent0d0f73fb67bbfcc53058cefded85ac36f951c7a7 (diff)
downloadvolse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.gz
volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.tar.bz2
volse-hubzilla-a75c61d71efebf43713026200aa0f513bd7eef09.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Daemon/Channel_purge.php')
-rw-r--r--Zotlabs/Daemon/Channel_purge.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Channel_purge.php b/Zotlabs/Daemon/Channel_purge.php
new file mode 100644
index 000000000..9fceb0fb9
--- /dev/null
+++ b/Zotlabs/Daemon/Channel_purge.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Zotlabs\Daemon;
+
+class Channel_purge {
+
+ static public function run($argc,$argv) {
+
+ cli_startup();
+
+ $channel_id = intval($argv[1]);
+
+ $channel = q("select * from channel where channel_id = %d and channel_removed = 1",
+ intval($channel_id)
+ );
+
+ if (! $channel) {
+ return;
+ }
+
+ do {
+ $r = q("select id from item where uid = %d and item_deleted = 0 limit 1000",
+ intval($channel_id)
+ );
+ if ($r) {
+ foreach ($r as $rv) {
+ drop_item($rv['id'], false);
+ }
+ }
+ } while ($r);
+
+ return;
+ }
+}