Merge pull request #936 from git-marijus/master
this query can take quite a while if there were many updates but it has ...
This commit is contained in:
commit
10de423dde
@ -976,6 +976,18 @@ function pipe_streams($in, $out) {
|
|||||||
return $size;
|
return $size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Activity for files
|
||||||
|
*
|
||||||
|
* @param $channel_id
|
||||||
|
* @param $object
|
||||||
|
* @param $allow_cid
|
||||||
|
* @param $allow_gid
|
||||||
|
* @param $deny_cid
|
||||||
|
* @param $deny_gid
|
||||||
|
* @param $verb
|
||||||
|
* @param $no_activity
|
||||||
|
*/
|
||||||
function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $verb, $no_activity) {
|
function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $verb, $no_activity) {
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
@ -1030,7 +1042,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
|
|||||||
$jsonobject = json_encode($object);
|
$jsonobject = json_encode($object);
|
||||||
|
|
||||||
//check if item for this object exists
|
//check if item for this object exists
|
||||||
$y = q("SELECT * FROM item WHERE verb = '%s' AND obj_type = '%s' AND resource_id = '%s' AND uid = %d LIMIT 1",
|
$y = q("SELECT mid FROM item WHERE verb = '%s' AND obj_type = '%s' AND resource_id = '%s' AND uid = %d LIMIT 1",
|
||||||
dbesc(ACTIVITY_POST),
|
dbesc(ACTIVITY_POST),
|
||||||
dbesc($objtype),
|
dbesc($objtype),
|
||||||
dbesc($object['hash']),
|
dbesc($object['hash']),
|
||||||
@ -1143,6 +1155,13 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Create file activity object
|
||||||
|
*
|
||||||
|
* @param $channel_id
|
||||||
|
* @param $hash
|
||||||
|
* @param $cloudpath
|
||||||
|
*/
|
||||||
function get_file_activity_object($channel_id, $hash, $cloudpath) {
|
function get_file_activity_object($channel_id, $hash, $cloudpath) {
|
||||||
|
|
||||||
$x = q("SELECT creator, filename, filetype, filesize, revision, folder, flags, created, edited, allow_cid, allow_gid, deny_cid, deny_gid FROM attach WHERE uid = %d AND hash = '%s' LIMIT 1",
|
$x = q("SELECT creator, filename, filetype, filesize, revision, folder, flags, created, edited, allow_cid, allow_gid, deny_cid, deny_gid FROM attach WHERE uid = %d AND hash = '%s' LIMIT 1",
|
||||||
@ -1184,6 +1203,15 @@ function get_file_activity_object($channel_id, $hash, $cloudpath) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns array of channels which have recursive permission for a file
|
||||||
|
*
|
||||||
|
* @param $arr_allow_cid
|
||||||
|
* @param $arr_allow_gid
|
||||||
|
* @param $arr_deny_cid
|
||||||
|
* @param $arr_deny_gid
|
||||||
|
* @param $folder_hash
|
||||||
|
*/
|
||||||
function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny_cid, $arr_deny_gid, $folder_hash) {
|
function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny_cid, $arr_deny_gid, $folder_hash) {
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
@ -1295,6 +1323,12 @@ function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns members of a group
|
||||||
|
*
|
||||||
|
* @param $group_id
|
||||||
|
*/
|
||||||
function in_group($group_id) {
|
function in_group($group_id) {
|
||||||
$group_members = array();
|
$group_members = array();
|
||||||
|
|
||||||
|
@ -43,6 +43,12 @@ function poller_run($argv, $argc){
|
|||||||
proc_run('php',"include/queue.php");
|
proc_run('php',"include/queue.php");
|
||||||
|
|
||||||
|
|
||||||
|
// maintenance for mod sharedwithme - check for updated items and remove them
|
||||||
|
|
||||||
|
require_once('include/sharedwithme.php');
|
||||||
|
apply_updates();
|
||||||
|
|
||||||
|
|
||||||
// expire any expired mail
|
// expire any expired mail
|
||||||
|
|
||||||
q("delete from mail where expires != '%s' and expires < %s ",
|
q("delete from mail where expires != '%s' and expires < %s ",
|
||||||
|
Reference in New Issue
Block a user