sforkowany z mirror/social
fixing some stuff
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>alpha1
rodzic
16d42a9e53
commit
1875e7fe88
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Ładowanie…
Reference in New Issue