Skip to content
Commits on Source (12)
......@@ -51,7 +51,7 @@ class issues implements Interfaces\Api
$issue = new Issue;
$issue->setTitle($title)
->setDescription($description)
->setLabels('S - Triage (New), T - Bug (Triage)');
->setLabels('Status::Validation, Type::Bug (Triage)');
// call gitlab api
$res = $manager->postIssue($issue, $pages[0]);
......
......@@ -95,7 +95,7 @@ class EarningsDashboard implements DashboardInterface
return [
'category' => 'earnings',
'label' => 'Pro Earnings',
'description' => 'Earnings for PRO members will be paid out within 30 days upon reaching a minumum balance of $100.00.',
'description' => 'Earnings for Pro members will be paid out within 30 days upon reaching a minumum balance of $100.00.',
'timespan' => $this->timespansCollection->getSelected()->getId(),
'timespans' => $this->timespansCollection->export(),
'metric' => $this->metricsCollection->getSelected()->getId(),
......
......@@ -57,6 +57,9 @@ class Video implements AssetsInterface
$file->write($data);
$file->close();
$this->entity->last_updated = time();
$this->entity->save();
$assets['thumbnail'] = $filename;
}
......
......@@ -42,6 +42,7 @@ class Manager
{
$uri = null;
$asset_guid = null;
$lastUpdated = null;
switch (get_class($entity)) {
case Activity::class:
switch ($entity->get('custom_type')) {
......@@ -51,19 +52,21 @@ class Manager
default:
$asset_guid = $entity->get('entity_guid');
}
$lastUpdated = $entity->get('last_updated');
break;
case Image::class:
$asset_guid = $entity->getGuid();
break;
case Video::class:
$asset_guid = $entity->getGuid();
$lastUpdated = $entity->get('last_updated');
break;
case Comment::class:
$asset_guid = $entity->getAttachments()['attachment_guid'];
break;
}
$uri = $this->config->get('cdn_url') . 'fs/v1/thumbnail/' . $asset_guid . '/' . $size;
$uri = $this->config->get('cdn_url') . 'fs/v1/thumbnail/' . $asset_guid . '/' . $size . '/' . $lastUpdated;
if ($entity->access_id !== ACCESS_PUBLIC) {
$uri = $this->signUri($uri);
......
......@@ -26,9 +26,10 @@ class Thumbnails
*/
public function get($entity, $size)
{
if (is_string($entity)) {
$entity = $this->entitiesBuilder->build($entity);
if (is_numeric($entity)) {
$entity = $this->entitiesBuilder->single($entity);
}
if (!$entity || !Core\Security\ACL::_()->read($entity)) {
return false;
}
......
......@@ -279,6 +279,15 @@ class Push implements Interfaces\NotificationExtensionInterface
case 'messenger_invite':
return sprintf('@%s wants to chat with you!', $name);
case 'referral_ping':
return sprintf('Free tokens are waiting for you! Once you join the rewards program by setting up your Minds wallet, both you and @%s will earn tokens for your referral', $name);
case 'referral_pending':
return sprintf('You have a pending referral! @%s used your referral link when they signed up for Minds. You\'ll get tokens once they join the rewards program and set up their wallet', $name);
case 'referral_complete':
return sprintf('You\'ve earned tokens for the completed referral of @%s', $name);
default:
return "";
}
......
......@@ -29,7 +29,9 @@ class Spam
$foundSpam = Text::strposa($entity->getBody(), ProhibitedDomains::DOMAINS);
break;
}
$foundSpam = Text::strposa($entity->getDescription(), ProhibitedDomains::DOMAINS);
if (method_exists($entity, 'getDescription')) {
$foundSpam = Text::strposa($entity->getDescription(), ProhibitedDomains::DOMAINS);
}
break;
case 'user':
$foundSpam = Text::strposa($entity->briefdescription, ProhibitedDomains::DOMAINS);
......
......@@ -386,4 +386,26 @@ class Image extends File
$this->time_sent = $time_sent;
return $this;
}
/**
* Return description
* @return string
*/
public function getDescription(): string
{
return $this->description ?: '';
}
/**
* Set description
*
* @param string $description - description to be set.
* @return Image
*/
public function setDescription($description): Image
{
$this->description = $description;
return $this;
}
}
......@@ -296,4 +296,25 @@ class Video extends MindsObject
$this->time_sent = $time_sent;
return $this;
}
/**
* Return description
* @return string
*/
public function getDescription(): string
{
return $this->description ?: '';
}
/**
* Set description
*
* @param string $description - description to be set.
* @return Video
*/
public function setDescription($description): Video
{
$this->description = $description;
return $this;
}
}
......@@ -34,9 +34,10 @@ class ManagerSpec extends ObjectBehavior
$activity = new Activity();
$activity->set('entity_guid', 123);
$activity->set('access_id', ACCESS_PRIVATE);
$activity->set('last_updated', 1575542933);
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge';
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge/1575542933';
$this->signedUri->sign($uri, Argument::any())
->willReturn('signed url will be here');
$this->getPublicAssetUri($activity)
......@@ -48,10 +49,11 @@ class ManagerSpec extends ObjectBehavior
$activity = new Activity();
$activity->set('entity_guid', 123);
$activity->set('access_id', ACCESS_PUBLIC);
$activity->set('last_updated', 1575542933);
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$this->getPublicAssetUri($activity)
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge');
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge/1575542933');
}
public function it_should_return_public_asset_uri_for_image()
......@@ -61,7 +63,7 @@ class ManagerSpec extends ObjectBehavior
$entity->set('access_id', ACCESS_PRIVATE);
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge';
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge/';
$this->signedUri->sign($uri, Argument::any())
->willReturn('signed url will be here');
$this->getPublicAssetUri($entity)
......@@ -76,7 +78,7 @@ class ManagerSpec extends ObjectBehavior
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$this->getPublicAssetUri($entity)
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge');
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge/');
}
public function it_should_return_public_asset_uri_for_video()
......@@ -84,9 +86,10 @@ class ManagerSpec extends ObjectBehavior
$entity = new Video();
$entity->set('guid', 123);
$entity->set('access_id', ACCESS_PRIVATE);
$entity->set('last_updated', 1575542933);
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge';
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge/1575542933';
$this->signedUri->sign($uri, Argument::any())
->willReturn('signed url will be here');
$this->getPublicAssetUri($entity)
......@@ -98,11 +101,12 @@ class ManagerSpec extends ObjectBehavior
$entity = new Video();
$entity->set('guid', 123);
$entity->set('access_id', ACCESS_PUBLIC);
$entity->set('last_updated', 1575542933);
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge';
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge/1575542933';
$this->getPublicAssetUri($entity)
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge');
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge/1575542933');
}
......@@ -112,7 +116,7 @@ class ManagerSpec extends ObjectBehavior
$entity->setAttachment('attachment_guid', '123');
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge';
$uri = 'https://minds.dev/fs/v1/thumbnail/123/xlarge/';
$this->signedUri->sign($uri, Argument::any())
->willReturn('signed url will be here');
$this->getPublicAssetUri($entity)
......@@ -127,6 +131,6 @@ class ManagerSpec extends ObjectBehavior
$this->config->get('cdn_url')
->willReturn('https://minds.dev/');
$this->getPublicAssetUri($entity)
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge');
->shouldBe('https://minds.dev/fs/v1/thumbnail/123/xlarge/');
}
}
......@@ -879,8 +879,9 @@ function elgg_get_entities(array $options = array()) {
}
$entity = entity_row_to_elggstar($newrow);
if(Minds\Core\Security\ACL::_()->read($entity))
if ($entity && Minds\Core\Security\ACL::_()->read($entity)) {
$entities[] = $entity;
}
}
}
} catch(Exception $e){
......