fixing some stuff

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
alpha1
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 { try {
$note = $this->noteService->getNoteById($id); $note = $this->noteService->getNoteById($id);
$actor = $this->actorService->getActorFromUserId($this->userId); $actor = $this->actorService->getActorFromUserId($this->userId);
if ($note->getAttributedTo() !== $actor->getId()) { if ($note->getAttributedTo() !== $actor->getId()) {
throw new InvalidResourceException('user have no rights'); throw new InvalidResourceException('user have no rights');
} }

Wyświetl plik

@ -52,7 +52,8 @@ class FollowsRequest extends FollowsRequestBuilder {
$qb = $this->getFollowsInsertSql(); $qb = $this->getFollowsInsertSql();
$qb->setValue('id', $qb->createNamedParameter($follow->getId())) $qb->setValue('id', $qb->createNamedParameter($follow->getId()))
->setValue('actor_id', $qb->createNamedParameter($follow->getActorId())) ->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(); $qb->execute();
} }

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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