diff options
author | Zot <mike@macgirvin.com> | 2020-06-17 09:12:15 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-06-17 09:12:15 +0200 |
commit | 36e969fd79a252e9aef7a87b8fa2d5f7c75ecd6d (patch) | |
tree | 143eabe58d54983cda8061c3e9a97bc7141d3812 /Zotlabs | |
parent | a88233a045679f3d7ea4c14eb68e62816fb10ba7 (diff) | |
download | volse-hubzilla-36e969fd79a252e9aef7a87b8fa2d5f7c75ecd6d.tar.gz volse-hubzilla-36e969fd79a252e9aef7a87b8fa2d5f7c75ecd6d.tar.bz2 volse-hubzilla-36e969fd79a252e9aef7a87b8fa2d5f7c75ecd6d.zip |
zap group compatibility - rewrites DMs and wall-to-wall posts to group pages as new posts authored by the group with an embedded reshare. This currently has known delivery issues due to zot/zot6 xchan confusion which are already slated for resolution in hz5. Specifically "sender is not owner/author" and missing abconfig permissions on the zot6 identity for a channel we're connected with over traditional zot.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Access/PermissionRoles.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 26 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Zotlabs/Access/PermissionRoles.php b/Zotlabs/Access/PermissionRoles.php index c8b4953a5..82df0c34b 100644 --- a/Zotlabs/Access/PermissionRoles.php +++ b/Zotlabs/Access/PermissionRoles.php @@ -100,6 +100,7 @@ class PermissionRoles { 'post_mail', 'post_like' , 'republish', 'chat' ]; $ret['limits'] = PermissionLimits::Std_Limits(); + $ret['channel_type'] = 'group'; break; @@ -113,6 +114,7 @@ class PermissionRoles { 'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver', 'post_mail', 'post_like' , 'chat' ]; $ret['limits'] = PermissionLimits::Std_Limits(); + $ret['channel_type'] = 'group'; break; @@ -132,6 +134,7 @@ class PermissionRoles { $ret['limits']['view_storage'] = PERMS_SPECIFIC; $ret['limits']['view_pages'] = PERMS_SPECIFIC; $ret['limits']['view_wiki'] = PERMS_SPECIFIC; + $ret['channel_type'] = 'group'; break; @@ -187,6 +190,7 @@ class PermissionRoles { 'post_mail', 'post_like' , 'republish', 'chat', 'write_wiki' ]; $ret['limits'] = PermissionLimits::Std_Limits(); + $ret['channel_type'] = 'group'; break; diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 95359ccad..29563a9a5 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') { @@ -1233,7 +1253,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 ]); |