improve file_activity() a little
This commit is contained in:
parent
79a806f328
commit
9ec995dbf0
@ -5,14 +5,6 @@ namespace Zotlabs\Module;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('include/attach.php');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param object &$a
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Filestorage extends \Zotlabs\Web\Controller {
|
class Filestorage extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
@ -36,7 +28,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
|
|||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
$acl = new \Zotlabs\Access\AccessList($channel);
|
$acl = new \Zotlabs\Access\AccessList($channel);
|
||||||
$acl->set_from_array($_REQUEST);
|
$acl->set_from_array($_POST);
|
||||||
$x = $acl->get();
|
$x = $acl->get();
|
||||||
|
|
||||||
$url = get_cloud_url($channel_id, $channel['channel_address'], $resource);
|
$url = get_cloud_url($channel_id, $channel['channel_address'], $resource);
|
||||||
|
@ -4,6 +4,11 @@ require_once('include/conversation.php');
|
|||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file Zotlabs/Module/Sharedwithme.php
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
class Sharedwithme extends \Zotlabs\Web\Controller {
|
class Sharedwithme extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
|
@ -1684,17 +1684,9 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
|
|||||||
$arr['obj'] = $u_jsonobject;
|
$arr['obj'] = $u_jsonobject;
|
||||||
$arr['body'] = '';
|
$arr['body'] = '';
|
||||||
|
|
||||||
$post = item_store($arr);
|
post_activity_item($arr);
|
||||||
$item_id = $post['item_id'];
|
|
||||||
if($item_id) {
|
|
||||||
Zotlabs\Daemon\Master::Summon(array('Notifier','activity',$item_id));
|
|
||||||
}
|
|
||||||
|
|
||||||
call_hooks('post_local_end', $arr);
|
|
||||||
|
|
||||||
$update = false;
|
$update = false;
|
||||||
|
|
||||||
//notice( t('File activity updated') . EOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//don't create new activity if notify was not enabled
|
//don't create new activity if notify was not enabled
|
||||||
@ -1719,16 +1711,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
|
|||||||
$arr['obj'] = (($update) ? $u_jsonobject : $jsonobject);
|
$arr['obj'] = (($update) ? $u_jsonobject : $jsonobject);
|
||||||
$arr['body'] = '';
|
$arr['body'] = '';
|
||||||
|
|
||||||
$post = item_store($arr);
|
post_activity_item($arr);
|
||||||
$item_id = $post['item_id'];
|
|
||||||
|
|
||||||
if($item_id) {
|
|
||||||
Zotlabs\Daemon\Master::Summon(array('Notifier','activity',$item_id));
|
|
||||||
}
|
|
||||||
|
|
||||||
call_hooks('post_local_end', $arr);
|
|
||||||
|
|
||||||
//(($verb === 'post') ? notice( t('File activity posted') . EOL) : notice( t('File activity dropped') . EOL));
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1894,7 +1877,7 @@ function recursive_activity_recipients($arr_allow_cid, $arr_allow_gid, $arr_deny
|
|||||||
|
|
||||||
//if none is allowed restrict to self
|
//if none is allowed restrict to self
|
||||||
if(($r_arr_allow_gid === false) && ($r_arr_allow_cid === false)) {
|
if(($r_arr_allow_gid === false) && ($r_arr_allow_cid === false)) {
|
||||||
$ret['allow_cid'] = $poster['xchan_hash'];
|
$ret['allow_cid'] = [$poster['xchan_hash']];
|
||||||
} else {
|
} else {
|
||||||
$ret['allow_gid'] = $r_arr_allow_gid;
|
$ret['allow_gid'] = $r_arr_allow_gid;
|
||||||
$ret['allow_cid'] = $r_arr_allow_cid;
|
$ret['allow_cid'] = $r_arr_allow_cid;
|
||||||
|
Reference in New Issue
Block a user