aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-04-25 09:15:20 +0000
committerMario <mario@mariovavti.com>2020-04-25 09:15:20 +0000
commitc229f058b4331e3b631d9ca725385ef78bf59778 (patch)
treee54e4d3e6ef9c8030f0a7bddb2a49f270fcc9697
parente2b10f52e02c4cee77af089a544ec55e62048aba (diff)
downloadvolse-hubzilla-c229f058b4331e3b631d9ca725385ef78bf59778.tar.gz
volse-hubzilla-c229f058b4331e3b631d9ca725385ef78bf59778.tar.bz2
volse-hubzilla-c229f058b4331e3b631d9ca725385ef78bf59778.zip
fix mod filestorage and fetch the info from attach if only the hash is provided in attach_store_item()
-rw-r--r--Zotlabs/Module/Filestorage.php8
-rw-r--r--include/attach.php14
2 files changed, 18 insertions, 4 deletions
diff --git a/Zotlabs/Module/Filestorage.php b/Zotlabs/Module/Filestorage.php
index c40de2823..0c6233493 100644
--- a/Zotlabs/Module/Filestorage.php
+++ b/Zotlabs/Module/Filestorage.php
@@ -35,12 +35,12 @@ class Filestorage extends \Zotlabs\Web\Controller {
$url = get_cloud_url($channel_id, $channel['channel_address'], $resource);
- //get the object before permissions change so we can catch eventual former allowed members
- $object = get_file_activity_object($channel_id, $resource, $url);
-
attach_change_permissions($channel_id, $resource, $x['allow_cid'], $x['allow_gid'], $x['deny_cid'], $x['deny_gid'], $recurse, true);
- file_activity($channel_id, $object, $x['allow_cid'], $x['allow_gid'], $x['deny_cid'], $x['deny_gid'], 'post', $notify);
+ if($notify) {
+ $observer = \App::get_observer();
+ attach_store_item($channel, $observer, $resource);
+ }
goaway(dirname($url));
}
diff --git a/include/attach.php b/include/attach.php
index fbf131fb3..4c2459046 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1921,6 +1921,20 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid,
function attach_store_item($channel, $observer, $file) {
+
+ if(is_string($file)) {
+ $r = q("SELECT * FROM attach WHERE uid = %d AND hash = '%s' LIMIT 1",
+ intval($channel['channel_id']),
+ dbesc($file)
+ );
+
+ if(! $r)
+ return;
+
+ $file = $r[0];
+
+ }
+
$filetype_parts = explode('/', $file['filetype']);
switch($filetype_parts[0]) {