aboutsummaryrefslogtreecommitdiffstats
path: root/mod/filer.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-11 17:41:56 -0700
committerfriendica <info@friendica.com>2014-03-11 17:41:56 -0700
commit5e41ef921999e1dc4d29101d4d764db967e257ee (patch)
treed0321e21cbbaf2645bebd8f9e78518462e204590 /mod/filer.php
parentc903ff7aab3f7d094d0ae0c37f9fe46887cf2363 (diff)
downloadvolse-hubzilla-5e41ef921999e1dc4d29101d4d764db967e257ee.tar.gz
volse-hubzilla-5e41ef921999e1dc4d29101d4d764db967e257ee.tar.bz2
volse-hubzilla-5e41ef921999e1dc4d29101d4d764db967e257ee.zip
protect filed conversations from expiration - we check the parent to see if it is filed, but one may have filed a comment and that will vanish when the parent expires unless the parent is protected.
Diffstat (limited to 'mod/filer.php')
-rw-r--r--mod/filer.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/mod/filer.php b/mod/filer.php
index adc6245e1..3340fc999 100644
--- a/mod/filer.php
+++ b/mod/filer.php
@@ -19,6 +19,20 @@ function filer_content(&$a) {
if($item_id && strlen($term)){
// file item
store_item_tag(local_user(),$item_id,TERM_OBJ_POST,TERM_FILE,$term,'');
+
+ // protect the entire conversation from periodic expiration
+
+ $r = q("select parent from item where id = %d and uid = %d limit 1",
+ intval($item_id),
+ intval(local_user())
+ );
+ if($r) {
+ $x = q("update item set item_flags = ( item_flags | %d ) where id = %d and uid = %d limit 1",
+ intval(ITEM_RETAINED),
+ intval($r[0]['parent']),
+ intval(local_user())
+ );
+ }
}
else {
$filetags = array();