Provide backend option to only expire other peoples' conversations.

This commit is contained in:
friendica 2012-05-28 23:24:10 -07:00
parent 2dc7e53435
commit 0241bd1fbf

View file

@ -3076,13 +3076,20 @@ function item_getfeedattach($item) {
function item_expire($uid,$days) { function item_expire($uid,$days) {
if((! $uid) || (! $days)) if((! $uid) || ($days < 1))
return; return;
// $expire_network_only = save your own wall posts
// and just expire conversations started by others
$expire_network_only = get_pconfig($uid,'expire','expire_network_only');
$sql_extra = ((intval($expire_network_only)) ? " AND wall = 0 " : "");
$r = q("SELECT * FROM `item` $r = q("SELECT * FROM `item`
WHERE `uid` = %d WHERE `uid` = %d
AND `created` < UTC_TIMESTAMP() - INTERVAL %d DAY AND `created` < UTC_TIMESTAMP() - INTERVAL %d DAY
AND `id` = `parent` AND `id` = `parent`
$sql_extra
AND `deleted` = 0", AND `deleted` = 0",
intval($uid), intval($uid),
intval($days) intval($days)