diff options
author | Max Kostikov <max@kostikov.co> | 2020-07-19 14:58:19 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2020-07-19 14:58:19 +0200 |
commit | 5ea7196e78d08550b3ec93d3b708f915b3b0057f (patch) | |
tree | 07e5f865b6c83898d7ac508302a227509e8207fd /Zotlabs/Module/Item.php | |
parent | d0c7c99d5e1eb27281431231640c7e8c019b90e1 (diff) | |
parent | fcc47e69e424635fa54b2684329623d4f7694436 (diff) | |
download | volse-hubzilla-5ea7196e78d08550b3ec93d3b708f915b3b0057f.tar.gz volse-hubzilla-5ea7196e78d08550b3ec93d3b708f915b3b0057f.tar.bz2 volse-hubzilla-5ea7196e78d08550b3ec93d3b708f915b3b0057f.zip |
Merge branch 'dev' into 'dev'
Dev sync
See merge request kostikov/core!1
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 95359ccad..d8c837522 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -14,6 +14,7 @@ use Zotlabs\Web\HTTPSig; use Zotlabs\Lib\Libzot; use Zotlabs\Lib\Libsync; use Zotlabs\Lib\ThreadListener; +use Zotlabs\Access\PermissionRoles; use App; require_once('include/crypto.php'); @@ -677,6 +678,25 @@ class Item extends Controller { $str_contact_deny = $gacl['deny_cid']; $str_group_deny = $gacl['deny_gid']; + + $groupww = false; + + // if this is a wall-to-wall post to a group, turn it into a direct message + + $role = get_pconfig($profile_uid,'system','permissions_role'); + + $rolesettings = PermissionRoles::role_perms($role); + + $channel_type = isset($rolesettings['channel_type']) ? $rolesettings['channel_type'] : 'normal'; + + $is_group = (($channel_type === 'group') ? true : false); + + if (($is_group) && ($walltowall) && (! $walltowall_comment)) { + $groupww = true; + $str_contact_allow = $owner_xchan['xchan_hash']; + $str_group_allow = ''; + } + $post_tags = []; if($mimetype === 'text/bbcode') { @@ -796,8 +816,6 @@ class Item extends Controller { $i = 0; foreach($match[2] as $mtch) { $reshare = new \Zotlabs\Lib\Share($mtch); - $datarray['obj'] = $reshare->obj(); - $datarray['obj_type'] = $datarray['obj']['type']; $body = str_replace($match[1][$i],$reshare->bbcode(),$body); $i++; } @@ -1233,7 +1251,11 @@ class Item extends Controller { $datarray['llink'] = z_root() . '/display/' . gen_link_id($datarray['mid']); call_hooks('post_local_end', $datarray); - + + if ($groupww) { + $nopush = false; + } + if(! $nopush) Master::Summon([ 'Notifier', $notify_type, $post_id ]); |