aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Item.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r--Zotlabs/Module/Item.php36
1 files changed, 8 insertions, 28 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 9419dea0f..2ee639874 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -29,7 +29,7 @@ use \Zotlabs\Lib as Zlib;
class Item extends \Zotlabs\Web\Controller {
function post() {
-
+
// This will change. Figure out who the observer is and whether or not
// they have permission to post here. Else ignore the post.
@@ -237,10 +237,12 @@ class Item extends \Zotlabs\Web\Controller {
if($parent) {
logger('mod_item: item_post parent=' . $parent);
$can_comment = false;
- if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self']))
- $can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments');
- else
- $can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item);
+
+ $can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item);
+ if (!$can_comment) {
+ if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self'])==1 )
+ $can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments');
+ }
if(! $can_comment) {
notice( t('Permission denied.') . EOL) ;
@@ -533,7 +535,7 @@ class Item extends \Zotlabs\Web\Controller {
// Look for tags and linkify them
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
-logger('linkify: ' . print_r($results,true));
+
if($results) {
// Set permissions based on tag replacements
@@ -1163,28 +1165,6 @@ logger('linkify: ' . print_r($results,true));
return $ret;
}
- // auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts
- // and have uploaded something (like a profile photo), promote them to level 1.
-
- $a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)",
- intval($channel_id)
- );
- if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) {
- $x = q("select count(abook_id) as total from abook where abook_channel = %d",
- intval($channel_id)
- );
- if($x && intval($x[0]['total']) > 2) {
- $y = q("select count(id) as total from attach where uid = %d",
- intval($channel_id)
- );
- if($y && intval($y[0]['total']) > 1) {
- q("update account set account_level = 1 where account_id = %d",
- intval($a[0]['account_id'])
- );
- }
- }
- }
-
if (!$iswebpage) {
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {