Show bubble_timeline in the api if any instances are set in it #502

Merged
floatingghost merged 4 commits from foxing/akkoma:foxing-patch-1 into develop 2023-03-21 10:13:42 +00:00
Contributor

Display "bubble_timeline" in /api/v1/instance if any instances are set in the config/db.
Won't display it if none are shown to avoid other interfaces showing a blank timeline.

I have confirmed this change works on my instance, no instances set in adminfe and it will not show in the api.

Useful for external interface compatibility (even if there is none yet)

Any name for this works, I chose something that seemed sensible, but would be best to avoid setting it as "akkoma:xyz" so that other software can use the name too if they implement their own compatible bubble tl api.

Display "bubble_timeline" in /api/v1/instance if any instances are set in the config/db. Won't display it if none are shown to avoid other interfaces showing a blank timeline. I have confirmed this change works on my instance, no instances set in adminfe and it will not show in the api. Useful for external interface compatibility (even if there is none yet) Any name for this works, I chose something that seemed sensible, but would be best to avoid setting it as "akkoma:xyz" so that other software can use the name too if they implement their own compatible bubble tl api.
foxing added 1 commit 2023-03-11 03:40:51 +00:00
foxing added 1 commit 2023-03-11 19:09:15 +00:00
Merge branch 'develop' into foxing-patch-1
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending
e17d8f744e
floatingghost reviewed 2023-03-13 00:30:44 +00:00
@ -67,6 +67,9 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
"pleroma:api/v1/notifications:include_types_filter",
"quote_posting",
"editing",
if Config.get([:instance, :local_bubble], []) != [] do

it would probably be better to use Enum.empty? here, it's not recommended to check against an array literal

it would probably be better to use `Enum.empty?` here, it's not recommended to check against an array literal
Author
Contributor

I am not that well versed in elixir but I will have a look and try on my own instance, this was the best way I could find on my own since it should return the same if the list is empty or the config is completely undefined but the suggestion is helpful.

I am not that well versed in elixir but I will have a look and try on my own instance, this was the best way I could find on my own since it should return the same if the list is empty or the config is completely undefined but the suggestion is helpful.
Author
Contributor

Ok, less complicated than I expected, I have changed it, and it does work as expected on my instance.

Ok, less complicated than I expected, I have changed it, and it does work as expected on my instance.
foxing marked this conversation as resolved
foxing added 1 commit 2023-03-13 03:40:21 +00:00
Use enum empty instead
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending
ba635e97c8
foxing added 1 commit 2023-03-13 03:41:17 +00:00
floatingghost merged commit 281c4636fa into develop 2023-03-21 10:13:42 +00:00
floatingghost deleted branch foxing-patch-1 2023-03-21 10:13:42 +00:00

thanks!

thanks!
Sign in to join this conversation.
No description provided.