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.
This commit is contained in:
parent
c903ff7aab
commit
5e41ef9219
@ -9,7 +9,7 @@ function expire_run($argv, $argc){
|
||||
|
||||
// physically remove anything that has been deleted for more than two months
|
||||
|
||||
$r = q("delete from item where item_flags & %d and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY",
|
||||
$r = q("delete from item where ( item_flags & %d ) and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY",
|
||||
intval(ITEM_DELETED)
|
||||
);
|
||||
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user