...
 
Commits (6)
......@@ -88,7 +88,7 @@ class feed implements Interfaces\Api
/** @var Core\Boost\Network\Iterator $iterator */
$iterator = Core\Di\Di::_()->get('Boost\Network\Iterator');
$iterator
->setLimit(12)
->setLimit(10)
->setOffset($offset)
->setRating($rating)
->setQuality($quality)
......@@ -118,11 +118,13 @@ class feed implements Interfaces\Api
$next = $iterator->getOffset();
if (isset($boosts[1]) && !$isBoostFeed) { // Always offset to 2rd in list if in rotator
if (!$offset) {
$next = $boosts[1]->getTimestamp();
} else {
$next = 0;
}
// if (!$offset) {
// $next = $boosts[1]->getTimestamp();
// } else {
// $next = 0;
// }
$len = count($boosts);
$next = $boosts[$len -1]->getTimestamp();
} elseif ($isBoostFeed) {
$len = count($boosts);
$next = $boosts[$len -1]->getTimestamp();
......@@ -130,7 +132,7 @@ class feed implements Interfaces\Api
// $ttl = 1800; // 30 minutes
// if (($next / 1000) < strtotime('48 hours ago')) {
$ttl = 150; // 2.5 minutes;
$ttl = 300; // 5 minutes;
// }
$cacher->set(Core\Session::getLoggedinUser()->guid . ':boost-offset-rotator', $next, $ttl);
......
......@@ -192,7 +192,7 @@ class Push implements Interfaces\NotificationExtensionInterface
* @param mixed $entity
* @return string
*/
protected static function buildNotificationMessage(array $notification = [], $from_user, $entity)
public static function buildNotificationMessage(array $notification = [], $from_user, $entity)
{
$message = '';
......@@ -207,8 +207,22 @@ class Push implements Interfaces\NotificationExtensionInterface
$name = $from_user->name;
$isOwner = $notification['to'] == $entity->owner_guid;
$prefix = $isOwner ? 'your ': $entity->ownerObj['name']."'s ";
$desc = ($entity->type == 'activity') ? 'activity': $entity->subtype;
$prefix = '';
if ($isOwner) {
$prefix = 'your ';
} elseif (isset($entity->ownerObj['name'])) {
$prefix = $entity->ownerObj['name'].'\'s ';
}
$desc = 'a post';
if ($entity->type == 'activity') {
$desc = 'activity';
} elseif (isset($entity->subtype)) {
$desc = $entity->subtype;
} elseif ($isOwner || isset($entity->ownerObj['name'])) {
$desc = 'post';
}
$boostDescription = $entity->title ?: $entity->name ?: ($entity->type !== 'user' ? 'post' : 'channel');
......
This diff is collapsed.