From 0985ddb3ff76d24d8e157b7b41d86a5c98ed297a Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Tue, 15 Aug 2023 15:23:31 -0400 Subject: [PATCH] Add PR and Issue Numbers for TODO for createFromUriId hack in Mastodon API --- src/Module/Api/Mastodon/Statuses/Bookmark.php | 4 +++- src/Module/Api/Mastodon/Statuses/Favourite.php | 4 +++- src/Module/Api/Mastodon/Statuses/Mute.php | 4 +++- src/Module/Api/Mastodon/Statuses/Pin.php | 4 +++- src/Module/Api/Mastodon/Statuses/Reblog.php | 4 +++- src/Module/Api/Mastodon/Statuses/Unbookmark.php | 4 +++- src/Module/Api/Mastodon/Statuses/Unfavourite.php | 4 +++- src/Module/Api/Mastodon/Statuses/Unmute.php | 4 +++- src/Module/Api/Mastodon/Statuses/Unpin.php | 4 +++- src/Module/Api/Mastodon/Statuses/Unreblog.php | 4 +++- 10 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/Module/Api/Mastodon/Statuses/Bookmark.php b/src/Module/Api/Mastodon/Statuses/Bookmark.php index 9625b5e122..7f32c9a43c 100644 --- a/src/Module/Api/Mastodon/Statuses/Bookmark.php +++ b/src/Module/Api/Mastodon/Statuses/Bookmark.php @@ -65,7 +65,9 @@ class Bookmark extends BaseApi Item::update(['starred' => true], ['id' => $item['id']]); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Favourite.php b/src/Module/Api/Mastodon/Statuses/Favourite.php index 2e51591756..3543a3ba8f 100644 --- a/src/Module/Api/Mastodon/Statuses/Favourite.php +++ b/src/Module/Api/Mastodon/Statuses/Favourite.php @@ -49,7 +49,9 @@ class Favourite extends BaseApi Item::performActivity($item['id'], 'like', $uid); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Mute.php b/src/Module/Api/Mastodon/Statuses/Mute.php index 587999bad7..a99cd68635 100644 --- a/src/Module/Api/Mastodon/Statuses/Mute.php +++ b/src/Module/Api/Mastodon/Statuses/Mute.php @@ -53,7 +53,9 @@ class Mute extends BaseApi Post\ThreadUser::setIgnored($item['uri-id'], $uid, true); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Pin.php b/src/Module/Api/Mastodon/Statuses/Pin.php index 601f82f2d0..5d9a181135 100644 --- a/src/Module/Api/Mastodon/Statuses/Pin.php +++ b/src/Module/Api/Mastodon/Statuses/Pin.php @@ -48,7 +48,9 @@ class Pin extends BaseApi Post\Collection::add($item['uri-id'], Post\Collection::FEATURED, $item['author-id'], $uid); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(),$isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Reblog.php b/src/Module/Api/Mastodon/Statuses/Reblog.php index 409f8e788f..98cbd417d0 100644 --- a/src/Module/Api/Mastodon/Statuses/Reblog.php +++ b/src/Module/Api/Mastodon/Statuses/Reblog.php @@ -58,7 +58,9 @@ class Reblog extends BaseApi Item::performActivity($item['id'], 'announce', $uid); } - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Unbookmark.php b/src/Module/Api/Mastodon/Statuses/Unbookmark.php index 03a3e6f002..556db2b4b3 100644 --- a/src/Module/Api/Mastodon/Statuses/Unbookmark.php +++ b/src/Module/Api/Mastodon/Statuses/Unbookmark.php @@ -65,7 +65,9 @@ class Unbookmark extends BaseApi Item::update(['starred' => false], ['id' => $item['id']]); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Unfavourite.php b/src/Module/Api/Mastodon/Statuses/Unfavourite.php index d95d9e09c0..99358be55a 100644 --- a/src/Module/Api/Mastodon/Statuses/Unfavourite.php +++ b/src/Module/Api/Mastodon/Statuses/Unfavourite.php @@ -49,7 +49,9 @@ class Unfavourite extends BaseApi Item::performActivity($item['id'], 'unlike', $uid); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Unmute.php b/src/Module/Api/Mastodon/Statuses/Unmute.php index 63cd6d722d..b6d9c2b195 100644 --- a/src/Module/Api/Mastodon/Statuses/Unmute.php +++ b/src/Module/Api/Mastodon/Statuses/Unmute.php @@ -53,7 +53,9 @@ class Unmute extends BaseApi Post\ThreadUser::setIgnored($item['uri-id'], $uid, false); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Unpin.php b/src/Module/Api/Mastodon/Statuses/Unpin.php index 22610f4468..75b1d6fa5f 100644 --- a/src/Module/Api/Mastodon/Statuses/Unpin.php +++ b/src/Module/Api/Mastodon/Statuses/Unpin.php @@ -48,7 +48,9 @@ class Unpin extends BaseApi Post\Collection::remove($item['uri-id'], Post\Collection::FEATURED, $uid); - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); diff --git a/src/Module/Api/Mastodon/Statuses/Unreblog.php b/src/Module/Api/Mastodon/Statuses/Unreblog.php index a1544807f1..6730e0fb56 100644 --- a/src/Module/Api/Mastodon/Statuses/Unreblog.php +++ b/src/Module/Api/Mastodon/Statuses/Unreblog.php @@ -64,7 +64,9 @@ class Unreblog extends BaseApi Item::performActivity($item['id'], 'unannounce', $uid); } - // @TODO Remove once mstdnStatus()->createFromUriId is fixed + // @TODO Remove once mstdnStatus()->createFromUriId is fixed so that it returns posts not reshared posts if given an ID to an original post that has been reshared + // Introduced in this PR: https://github.com/friendica/friendica/pull/13175 + // Issue tracking the behavior of createFromUriId: https://github.com/friendica/friendica/issues/13350 $isReblog = $item['uri-id'] != $this->parameters['id']; System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, self::appSupportsQuotes(), $isReblog)->toArray()); -- 2.39.5