fixing some stuff

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/48/head
Maxence Lange 2018-11-21 20:58:56 -01:00
rodzic 16d42a9e53
commit 1875e7fe88
5 zmienionych plików z 8 dodań i 9 usunięć

Wyświetl plik

@ -158,7 +158,6 @@ class LocalController extends Controller {
try {
$note = $this->noteService->getNoteById($id);
$actor = $this->actorService->getActorFromUserId($this->userId);
if ($note->getAttributedTo() !== $actor->getId()) {
throw new InvalidResourceException('user have no rights');
}

Wyświetl plik

@ -52,7 +52,8 @@ class FollowsRequest extends FollowsRequestBuilder {
$qb = $this->getFollowsInsertSql();
$qb->setValue('id', $qb->createNamedParameter($follow->getId()))
->setValue('actor_id', $qb->createNamedParameter($follow->getActorId()))
->setValue('object_id', $qb->createNamedParameter($follow->getObjectId()));
->setValue('object_id', $qb->createNamedParameter($follow->getObjectId()))
->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId()));
$qb->execute();
}

Wyświetl plik

@ -110,7 +110,6 @@ class FollowService implements ICoreService {
try {
$this->followsRequest->getByPersons($actor->getId(), $remoteActor->getId());
} catch (FollowDoesNotExistException $e) {
$this->miscService->log('CREATE NEW ONE !');
$this->followsRequest->save($follow);
$follow->addInstancePath(

Wyświetl plik

@ -269,17 +269,18 @@ class NoteService implements ICoreService {
/**
* @param Note $note
*
* @throws ActorDoesNotExistException
* @throws RequestException
* @throws SocialAppConfigException
*/
public function deleteLocalNote(Note $note) {
if (!$note->isLocal()) {
return;
}
// $this->notesRequest->deleteNoteById($note->getId());
// $this->miscService->log('___' . json_encode($note->getInstancePaths()));
$note->setActorId($note->getAttributedTo());
$this->activityService->deleteActivity($note);
// $this->deleteService->deleteItem($note);
}

Wyświetl plik

@ -131,7 +131,6 @@ class ActivityService {
/**
* @param Person $actor
* @param ACore $item
* @param int $type
* @param ACore $activity
*
* @return array
@ -149,7 +148,7 @@ class ActivityService {
$activity->setObject($item);
$activity->setId($item->getId() . '/activity');
$activity->addInstancePaths($item->getInstancePaths());
$activity->setInstancePaths($item->getInstancePaths());
// if ($item->getToArray() !== []) {
// $activity->setToArray($item->getToArray());