aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-04-01 12:42:07 +0200
committerMario <mario@mariovavti.com>2019-04-01 12:42:07 +0200
commit2bdcd436bb3b8ed3090a500550bf93d30d15aa7f (patch)
tree44182c8a92515986e2ca704ba4c4bb2d4e1be96a
parentb384b275466655659c063253e82962c3fe524f6f (diff)
parenta1bea7d7cc33cfaec3114e7cb97093ec647a026a (diff)
downloadvolse-hubzilla-2bdcd436bb3b8ed3090a500550bf93d30d15aa7f.tar.gz
volse-hubzilla-2bdcd436bb3b8ed3090a500550bf93d30d15aa7f.tar.bz2
volse-hubzilla-2bdcd436bb3b8ed3090a500550bf93d30d15aa7f.zip
Merge branch 'dev' into 'dev'
check service class limits when syncing files See merge request hubzilla/core!1578
-rw-r--r--Zotlabs/Daemon/Notifier.php2
-rw-r--r--Zotlabs/Module/Item.php2
-rw-r--r--Zotlabs/Widget/Suggestions.php6
-rw-r--r--include/import.php14
4 files changed, 20 insertions, 4 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 4e0c0d49c..15dc08908 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -452,7 +452,7 @@ class Notifier {
$env_recips = (($private) ? array() : null);
- $details = q("select xchan_hash, xchan_instance_url, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . protect_sprintf(implode(',',$recipients)) . ")");
+ $details = q("select xchan_hash, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . protect_sprintf(implode(',',$recipients)) . ")");
$recip_list = array();
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index c466e7c82..6bc8c645f 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -166,7 +166,7 @@ class Item extends Controller {
if(! perm_is_allowed($chan['channel_id'],get_observer_hash(),'view_stream'))
http_status_exit(403, 'Forbidden');
- $i = Activity::encode_item_collection($nitems,'conversation/' . $item_id,'OrderedCollection',( defined('NOMADIC') ? false : true));
+ $i = Activity::encode_item_collection($nitems,'conversation/' . $item_id,'OrderedCollection');
if($portable_id) {
ThreadListener::store(z_root() . '/item/' . $item_id,$portable_id);
}
diff --git a/Zotlabs/Widget/Suggestions.php b/Zotlabs/Widget/Suggestions.php
index 5fb3d3e8b..b4f384e9d 100644
--- a/Zotlabs/Widget/Suggestions.php
+++ b/Zotlabs/Widget/Suggestions.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Widget;
+use Zotlabs\Lib\Apps;
+
require_once('include/socgraph.php');
@@ -9,9 +11,9 @@ class Suggestions {
function widget($arr) {
- if((! local_channel()) || (! feature_enabled(local_channel(),'suggest')))
- return '';
+ if((! local_channel()) || (! Apps::system_app_installed(local_channel(), 'Suggest Channels')))
+ return EMPTY_STR;
$r = suggestion_query(local_channel(),get_observer_hash(),0,20);
diff --git a/include/import.php b/include/import.php
index 8d1a19202..7a1e9aa55 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1155,6 +1155,9 @@ function sync_files($channel, $files) {
require_once('include/attach.php');
if($channel && $files) {
+
+ $limit = service_class_fetch($channel['channel_id'], 'attach_upload_limit');
+
foreach($files as $f) {
if(! $f)
continue;
@@ -1275,6 +1278,17 @@ function sync_files($channel, $files) {
}
else {
logger('sync_files attach does not exists: ' . print_r($att,true), LOGGER_DEBUG);
+
+ if($limit !== false) {
+ $r = q("select sum(filesize) as total from attach where aid = %d ",
+ intval($channel['channel_account_id'])
+ );
+ if(($r) && (($r[0]['total'] + $att['filesize']) > $limit)) {
+ logger('service class limit exceeded');
+ continue;
+ }
+ }
+
create_table_from_array('attach',$att);
}