Skip to content

Dictate Pleroma Chat and Quote Post compatibility by advertised features in the api

rurai10 requested to merge chizutan5/soapbox:develop-patch-51d8 into develop

Change features.ts to use the instance api to check if an instance supports quotes or pleroma chat, instead of hard coding by instance software name. This solves any issues where forked software is renamed and loses compatibility with these two features.

This has been tested on an akkoma instance that has had its software name changed and had pleroma chats restored, both features work as expected and show up in soapbox correctly. An older version of soapbox that was still compatible with these two things was previously used and neither features showed up.

-      v.software === PLEROMA && gte(v.version, '2.1.0') && v.build !== AKKOMA,

I don't think we need this at all, the earliest commit I can find where pleroma advertises pleroma chat in its api is this, which is well before pleroma chat was even released according to the changelog. Rebased also already advertises this in the api, I don't see this change affecting anyone negatively.

https://git.pleroma.social/pleroma/pleroma/-/blob/814c3e51714b2a7de30ed751a6aef361fc712807/lib/pleroma/web/mastodon_api/views/instance_view.ex#L73

2020-Aug-28 was the release date for 2.1.0, this change was authored on 2020-May-21 ​ ​ ​

+      features.includes('pleroma_chat_messages'),

We can use this instead of hardcoding software values to just look for the feature and enable based on that.

Akkoma instances not supporting chats won't have this in the api so won't get chats enabled, and there is a few private forks that do have chats restored (asbestos.cafe for example), which now allows soapbox to use chats on instances like that instead of blanket disabling them for instances advertised as akkoma ​ ​ ​

+            features.includes('quote_posting'),

Akkoma now advertises quote posts in its api with the same namespace as the PR in the pleroma repo does, so we can switch to looking for that. https://akkoma.dev/AkkomaGang/akkoma/pulls/496

But we should leave the old compatibility for akkoma in as many will not have this change.

Private forks wishing to enable soapbox quote post compatibility can then merge the change in the Akkoma PR (which doesn't seem difficult to ask for if they are already forking the software) and they will then be able to use them within all up to date soapbox installs, without needing to advertise a specific instance software name.

All new forks of Akkoma shouldn't have to do this from this point forward, and this should also allow forks of pleroma who merge in the quote posts PR to rename their software as they wish while maintaining compatibility.

Edited by rurai10

Merge request reports

Loading