aboutsummaryrefslogtreecommitdiffstats
path: root/include/connections.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-05-31 16:11:51 -0700
committerMario <mario@mariovavti.com>2018-06-08 08:37:36 +0200
commit5e5b9895df89956af61ec7fa423cfc40b6089bdd (patch)
tree94a18faef33e40d5ae66efb89b5857bd8a23a35e /include/connections.php
parentac8f798e56acab73d6d3f4545a75b21669c9f565 (diff)
downloadvolse-hubzilla-5e5b9895df89956af61ec7fa423cfc40b6089bdd.tar.gz
volse-hubzilla-5e5b9895df89956af61ec7fa423cfc40b6089bdd.tar.bz2
volse-hubzilla-5e5b9895df89956af61ec7fa423cfc40b6089bdd.zip
when removing a connection, use the same rules as expire: don't remove items that are starred, filed, or that you replied to.
(cherry picked from commit 5d83469621facf89884ada4036bd25b7b566b616)
Diffstat (limited to 'include/connections.php')
-rw-r--r--include/connections.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/connections.php b/include/connections.php
index 32baa94bd..5a9e31950 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -374,14 +374,19 @@ function contact_remove($channel_id, $abook_id) {
return false;
- $r = q("select id from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d",
+ $r = q("select id from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d and item_retained = 0 and item_starred = 0",
dbesc($abook['abook_xchan']),
dbesc($abook['abook_xchan']),
intval($channel_id)
);
if($r) {
+ $r = fetch_post_tags($r,true);
+
foreach($r as $rr) {
- drop_item($rr['id'],false);
+ $terms = get_terms_oftype($item['term'],TERM_FILE);
+ if(! $terms) {
+ drop_item($rr['id'],false);
+ }
}
}