diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-06-25 14:29:32 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-06-25 14:29:32 +0200 |
commit | 62610b5ec0bfe5edffc073eb06c609f33464d34f (patch) | |
tree | 7e9c0255eadcb88c0d4146de669bdf74835915ea /include | |
parent | 259417815820d85deadaf90f6c0ed003880f373f (diff) | |
parent | 07f004342848c633c8108f97238eff2c8eb1658b (diff) | |
download | volse-hubzilla-62610b5ec0bfe5edffc073eb06c609f33464d34f.tar.gz volse-hubzilla-62610b5ec0bfe5edffc073eb06c609f33464d34f.tar.bz2 volse-hubzilla-62610b5ec0bfe5edffc073eb06c609f33464d34f.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include')
-rw-r--r-- | include/connections.php | 15 | ||||
-rwxr-xr-x | include/items.php | 24 |
2 files changed, 28 insertions, 11 deletions
diff --git a/include/connections.php b/include/connections.php index 5a9e31950..20f7c24ff 100644 --- a/include/connections.php +++ b/include/connections.php @@ -373,23 +373,24 @@ function contact_remove($channel_id, $abook_id) { if(intval($abook['abook_self'])) return false; - $r = q("select id from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d and item_retained = 0 and item_starred = 0", dbesc($abook['abook_xchan']), dbesc($abook['abook_xchan']), intval($channel_id) ); if($r) { - $r = fetch_post_tags($r,true); - foreach($r as $rr) { - $terms = get_terms_oftype($item['term'],TERM_FILE); - if(! $terms) { - drop_item($rr['id'],false); + $x = q("select uid from term where otype = %d and oid = %d ttype = %d limit 1", + intval(TERM_OBJ_POST), + intval($rr['id']), + intval(TERM_FILE) + ); + if($x) { + continue; } + drop_item($rr['id'],false); } } - q("delete from abook where abook_id = %d and abook_channel = %d", intval($abook['abook_id']), diff --git a/include/items.php b/include/items.php index 54df5d322..8e7a8df34 100755 --- a/include/items.php +++ b/include/items.php @@ -19,9 +19,10 @@ require_once('include/permissions.php'); * * @param array $item * @param[out] boolean $private_envelope + * @param boolean $include_groups * @return array containing the recipients */ -function collect_recipients($item, &$private_envelope) { +function collect_recipients($item, &$private_envelope,$include_groups = true) { require_once('include/group.php'); @@ -34,7 +35,12 @@ function collect_recipients($item, &$private_envelope) { $allow_people = expand_acl($item['allow_cid']); - $allow_groups = expand_groups(expand_acl($item['allow_gid'])); + if($include_groups) { + $allow_groups = expand_groups(expand_acl($item['allow_gid'])); + } + else { + $allow_groups = []; + } $recipients = array_unique(array_merge($allow_people,$allow_groups)); @@ -2948,6 +2954,18 @@ function start_delivery_chain($channel, $item, $item_id, $parent) { } } } + + // This will change the author to the post owner. Useful for RSS feeds which are to be syndicated + // to federated platforms which can't verify the identity of the author. + // This MAY cause you to run afoul of copyright law. + + $rewrite_author = intval(get_abconfig($channel['channel_id'],$item['owner_xchan'],'system','rself')); + if($rewrite_author) { + $item['author_xchan'] = $item['owner_xchan']; + if($item['owner']) { + $item['author'] = $item['owner']; + } + } } // Change this copy of the post to a forum head message and deliver to all the tgroup members @@ -3008,8 +3026,6 @@ function start_delivery_chain($channel, $item, $item_id, $parent) { ); - - if($r) Zotlabs\Daemon\Master::Summon(array('Notifier','tgroup',$item_id)); else { |