mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:35:13 +00:00
groups should not inherit foreign categories.
This commit is contained in:
parent
aeeadb6298
commit
ee38b8b699
2 changed files with 18 additions and 0 deletions
|
@ -2475,6 +2475,7 @@ function tag_deliver($uid, $item_id) {
|
|||
// and this will be turned into an embedded wall-to-wall post
|
||||
if(perm_is_allowed($uid, $item['author_xchan'], 'post_wall')) {
|
||||
logger('group DM delivery for ' . $u['channel_address']);
|
||||
$item = filter_categories($item);
|
||||
start_delivery_chain($u, $item, $item_id, false, true, (($item['edited'] != $item['created']) || $item['item_deleted']));
|
||||
q("update item set item_blocked = %d where id = %d",
|
||||
intval(ITEM_HIDDEN),
|
||||
|
@ -2504,6 +2505,7 @@ function tag_deliver($uid, $item_id) {
|
|||
if ($id == z_root() . '/outbox/' . $u['channel_address']) {
|
||||
if(perm_is_allowed($uid, $item['author_xchan'], 'post_wall')) {
|
||||
logger('group collection delivery for ' . $u['channel_address']);
|
||||
$item = filter_categories($item);
|
||||
start_delivery_chain($u, $item, $item_id, false, true, (($item['edited'] != $item['created']) || $item['item_deleted']));
|
||||
q("update item set item_blocked = %d where id = %d",
|
||||
intval(ITEM_HIDDEN),
|
||||
|
@ -2737,6 +2739,21 @@ function tag_deliver($uid, $item_id) {
|
|||
|
||||
}
|
||||
|
||||
function filter_categories($item)
|
||||
{
|
||||
$tags = [];
|
||||
if ($item['term'] && is_array($item['term'])) {
|
||||
foreach ($item['term'] as $tag) {
|
||||
if ($tag['ttype'] === TERM_CATEGORY || $tag['ttype'] === TERM_PCATEGORY) {
|
||||
continue;
|
||||
}
|
||||
$tags[] = $tag;
|
||||
}
|
||||
$item['term'] = $tags;
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief This function is called pre-deliver to see if a post matches the criteria to be tag delivered.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<!--suppress HtmlFormInputWithoutLabel -->
|
||||
<input id="invisible-wall-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50px;left:-50px;width:0;height:0;" multiple>
|
||||
<input id="invisible-comment-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50px;left:-50px;width:0;height:0;" multiple>
|
||||
<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-form_id="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
|
||||
|
|
Loading…
Reference in a new issue