Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
140
Issues
140
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
ddc2e70d
Commit
ddc2e70d
authored
1 hour ago
by
Mark Harding
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): apply channel tags to all entities
parent
8a53cac1
master
No related merge requests found
Pipeline
#64120334
passed with stages
in 9 minutes and 43 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
14 deletions
+35
-14
remind.php
Controllers/api/v2/newsfeed/remind.php
+15
-13
Save.php
Core/Entities/Actions/Save.php
+12
-1
SaveSpec.php
Spec/Core/Entities/Actions/SaveSpec.php
+8
-0
No files found.
Controllers/api/v2/newsfeed/remind.php
View file @
ddc2e70d
...
...
@@ -11,6 +11,7 @@ use Minds\Helpers;
use
Minds\Helpers\Counters
;
use
Minds\Interfaces
;
use
Minds\Interfaces\Flaggable
;
use
Minds\Core\Entities\Actions\Save
;
class
remind
implements
Interfaces\Api
{
...
...
@@ -59,6 +60,7 @@ class remind implements Interfaces\Api
}
}*/
$save
=
new
Save
();
$activity
=
new
Activity
();
$activity
->
setNSFW
(
$embedded
->
getNSFW
());
...
...
@@ -74,7 +76,7 @@ class remind implements Interfaces\Api
}
else
{
$activity
->
setRemind
(
$embedded
->
export
())
->
save
();
}
$
activity
->
save
();
$
save
->
setEntity
(
$activity
)
->
save
();
break
;
default
:
/**
...
...
@@ -89,8 +91,8 @@ class remind implements Interfaces\Api
->
setURL
(
$embedded
->
getURL
())
->
setThumbnail
(
$embedded
->
getIconUrl
())
->
setFromEntity
(
$embedded
)
->
setMessage
(
$message
)
->
save
();
->
setMessage
(
$message
)
;
$save
->
setEntity
(
$activity
)
->
save
();
}
else
{
$activity
->
setRemind
((
new
Activity
())
->
setTimeCreated
(
$embedded
->
getTimeCreated
())
...
...
@@ -100,8 +102,8 @@ class remind implements Interfaces\Api
->
setThumbnail
(
$embedded
->
getIconUrl
())
->
setFromEntity
(
$embedded
)
->
export
())
->
setMessage
(
$message
)
->
save
();
->
setMessage
(
$message
)
;
$save
->
setEntity
(
$activity
)
->
save
();
}
break
;
case
'video'
:
...
...
@@ -114,8 +116,8 @@ class remind implements Interfaces\Api
])
->
setTitle
(
$embedded
->
title
)
->
setBlurb
(
$embedded
->
description
)
->
setMessage
(
$message
)
->
save
();
->
setMessage
(
$message
)
;
$save
->
setEntity
(
$activity
)
->
save
();
}
else
{
$activity
=
new
Activity
();
$activity
->
setRemind
(
...
...
@@ -132,8 +134,8 @@ class remind implements Interfaces\Api
->
setBlurb
(
$embedded
->
description
)
->
export
()
)
->
setMessage
(
$message
)
->
save
();
->
setMessage
(
$message
)
;
$save
->
setEntity
(
$activity
)
->
save
();
}
break
;
case
'image'
:
...
...
@@ -150,8 +152,8 @@ class remind implements Interfaces\Api
->
setFromEntity
(
$embedded
)
->
setTitle
(
$embedded
->
title
)
->
setBlurb
(
$embedded
->
description
)
->
setMessage
(
$message
)
->
save
();
->
setMessage
(
$message
)
;
$save
->
setEntity
(
$activity
)
->
save
();
}
else
{
$activity
->
setRemind
(
(
new
Activity
())
...
...
@@ -171,8 +173,8 @@ class remind implements Interfaces\Api
->
setBlurb
(
$embedded
->
description
)
->
export
()
)
->
setMessage
(
$message
)
->
save
();
->
setMessage
(
$message
)
;
$save
->
setEntity
(
$activity
)
->
save
();
}
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Core/Entities/Actions/Save.php
View file @
ddc2e70d
...
...
@@ -10,6 +10,7 @@ namespace Minds\Core\Entities\Actions;
use
Minds\Core\Di\Di
;
use
Minds\Core\Events\Dispatcher
;
use
Minds\Helpers\MagicAttributes
;
class
Save
{
...
...
@@ -96,12 +97,22 @@ class Save
if
(
method_exists
(
$this
->
entity
,
'getOwnerEntity'
)
&&
$this
->
entity
->
getOwnerEntity
())
{
$nsfwReasons
=
array_merge
(
$nsfwReasons
,
$this
->
entity
->
getOwnerEntity
()
->
getNSFW
());
$nsfwReasons
=
array_merge
(
$nsfwReasons
,
$this
->
entity
->
getOwnerEntity
()
->
getNSFWLock
());
// Legacy explicit follow through
if
(
$this
->
entity
->
getOwnerEntity
()
->
isMature
())
{
$nsfwReasons
=
array_merge
(
$nsfwReasons
,
[
6
]);
if
(
MagicAttributes
::
setterExists
(
$this
->
entity
,
'setMature'
))
{
$this
->
entity
->
setMature
(
true
);
}
elseif
(
method_exists
(
$this
->
entity
,
'setFlag'
))
{
$this
->
entity
->
setFlag
(
'mature'
,
true
);
}
}
}
if
(
method_exists
(
$this
->
entity
,
'getContainerEntity'
)
&&
$this
->
entity
->
getContainerEntity
())
{
$nsfwReasons
=
array_merge
(
$nsfwReasons
,
$this
->
entity
->
getContainerEntity
()
->
getNSFW
());
$nsfwReasons
=
array_merge
(
$nsfwReasons
,
$this
->
entity
->
getContainerEntity
()
->
getNSFWLock
());
}
$this
->
entity
->
setNSFW
(
$nsfwReasons
);
}
}
This diff is collapsed.
Click to expand it.
Spec/Core/Entities/Actions/SaveSpec.php
View file @
ddc2e70d
...
...
@@ -90,6 +90,10 @@ class SaveSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
([]);
$owner
->
isMature
()
->
shouldBeCalled
()
->
willReturn
(
false
);
$activity
->
getOwnerEntity
()
->
shouldBeCalled
()
->
willReturn
(
$owner
);
...
...
@@ -128,6 +132,10 @@ class SaveSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
(
$nsfw
);
$owner
->
isMature
()
->
shouldBeCalled
()
->
willReturn
(
false
);
$activity
->
getOwnerEntity
()
->
shouldBeCalled
()
->
willReturn
(
$owner
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment