source verification

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/37/head
Maxence Lange 2018-11-19 11:24:53 -01:00
rodzic 31b729f5d4
commit 6eb6561737
2 zmienionych plików z 15 dodań i 2 usunięć

Wyświetl plik

@ -181,7 +181,6 @@ class FollowService implements ICoreService {
*/
public function save(ACore $follow) {
/** @var Follow $follow */
if ($follow->isRoot()) {
$follow->verify($follow->getActorId());
try {

Wyświetl plik

@ -37,6 +37,7 @@ use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\RequestException;
use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Activity\Create;
use OCA\Social\Model\ActivityPub\Note;
use OCA\Social\Model\ActivityPub\Person;
use OCA\Social\Model\InstancePath;
@ -229,7 +230,20 @@ class NoteService implements ICoreService {
*/
public function save(ACore $note) {
/** @var Note $note */
$this->notesRequest->save($note);
if ($note->isRoot()) {
return;
}
$parent = $note->getParent();
if ($parent->isRoot() === false) {
return;
}
if ($parent->getType() === Create::TYPE) {
$parent->verify(($note->getAttributedTo()));
$this->notesRequest->save($note);
}
}