mirror of
https://github.com/friendica/friendica
synced 2025-04-27 15:10:11 +00:00
Forums now are working with AP as well
This commit is contained in:
parent
4b98200315
commit
cd0d6cb626
4 changed files with 82 additions and 44 deletions
|
@ -3592,4 +3592,31 @@ class Item extends BaseObject
|
|||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the given item array a post that is sent as starting post to a forum?
|
||||
*
|
||||
* @param array $item
|
||||
* @param array $owner
|
||||
*
|
||||
* @return boolean "true" when it is a forum post
|
||||
*/
|
||||
public static function isForumPost(array $item, array $owner = [])
|
||||
{
|
||||
if (empty($owner)) {
|
||||
$owner = User::getOwnerDataById($item['uid']);
|
||||
if (empty($owner)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (($item['author-id'] == $item['owner-id']) ||
|
||||
($owner['id'] == $item['contact-id']) ||
|
||||
($item['uri'] != $item['parent-uri']) ||
|
||||
$item['origin']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Contact::isForum($item['contact-id']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue