Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -16,6 +16,8 @@ use BadMethodCallException;
|
||||
use IPS\Application;
|
||||
use IPS\Content;
|
||||
use IPS\Content\Filter;
|
||||
use IPS\Content\Hideable;
|
||||
use IPS\Content\Item;
|
||||
use IPS\Content\Tag;
|
||||
use IPS\Content\Taggable;
|
||||
use IPS\DateTime;
|
||||
@@ -151,6 +153,13 @@ class Digest
|
||||
try
|
||||
{
|
||||
$item = $class::load( $row['tag_meta_id'] );
|
||||
|
||||
/* Make sure the item is valid for a digest */
|
||||
if( !$this->includeItem( $item ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$areaPlainOutput .= Email::template( $row['tag_meta_app'], 'digests__item', 'plaintext', array( $item, $this->mail ) );
|
||||
$areaHtmlOutput .= Email::template( $row['tag_meta_app'], 'digests__item', 'html', array( $item, $this->mail ) );
|
||||
|
||||
@@ -243,23 +252,15 @@ class Digest
|
||||
{
|
||||
try
|
||||
{
|
||||
/* @var Item $item */
|
||||
$item = $class::load( $follow['follow_rel_id'] );
|
||||
|
||||
/* Check the view permission */
|
||||
if( !$item->canView( $this->member ) )
|
||||
/* Make sure the item is valid for a digest */
|
||||
if( !$this->includeItem( $item ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Make sure the item is not archived */
|
||||
if ( isset( $item::$archiveClass ) and method_exists( $item, 'isArchived' ) )
|
||||
{
|
||||
if ( $item->isArchived() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Force custom profile fields not to be returned, as they can reference templates */
|
||||
if( isset( $item::$commentClass ) )
|
||||
{
|
||||
@@ -305,6 +306,40 @@ class Digest
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the item should be included in the digest.
|
||||
* We have several areas above that don't rely on the Filters,
|
||||
* so we need to check it here.
|
||||
*
|
||||
* @param Item $item
|
||||
* @return bool
|
||||
*/
|
||||
protected function includeItem( Item $item ) : bool
|
||||
{
|
||||
/* Check the view permission */
|
||||
if( !$item->canView( $this->member ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Skip content pending deletion */
|
||||
if( $item->hidden() === -2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Make sure the item is not archived */
|
||||
if ( isset( $item::$archiveClass ) and method_exists( $item, 'isArchived' ) )
|
||||
{
|
||||
if ( $item->isArchived() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Digest
|
||||
|
||||
Reference in new issue
Block a user