fix for pleroma emoji reactions
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -2023,7 +2023,7 @@ class PlApiClient {
|
||||
const apiVersions = this.#instance.api_versions;
|
||||
|
||||
let response;
|
||||
if (apiVersions['pleroma_emoji_reactions.pleroma.pl-api'] >= 1) {
|
||||
if (apiVersions['emoji_reactions.pleroma.pl-api'] >= 1) {
|
||||
response = await this.request(`/api/v1/pleroma/statuses/${statusId}/reactions${emoji ? `/${emoji}` : ''}`);
|
||||
} else if (apiVersions['emoji_reaction.fedibird.pl-api'] >= 1) {
|
||||
response = await this.request(`/api/v1/statuses/${statusId}/emoji_reactioned_by`);
|
||||
@ -2056,7 +2056,7 @@ class PlApiClient {
|
||||
const apiVersions = this.#instance.api_versions;
|
||||
|
||||
let response;
|
||||
if (apiVersions['pleroma_emoji_reactions.pleroma.pl-api'] >= 1) {
|
||||
if (apiVersions['emoji_reactions.pleroma.pl-api'] >= 1) {
|
||||
response = await this.request(`/api/v1/pleroma/statuses/${statusId}/reactions/${encodeURIComponent(emoji)}`, { method: 'PUT' });
|
||||
} else {
|
||||
response = await this.request(`/api/v1/statuses/${statusId}/react/${encodeURIComponent(emoji)}`, { method: 'POST' });
|
||||
@ -2075,7 +2075,7 @@ class PlApiClient {
|
||||
const apiVersions = this.#instance.api_versions;
|
||||
|
||||
let response;
|
||||
if (apiVersions['pleroma_emoji_reactions.pleroma.pl-api'] >= 1) {
|
||||
if (apiVersions['emoji_reactions.pleroma.pl-api'] >= 1) {
|
||||
response = await this.request(`/api/v1/pleroma/statuses/${statusId}/reactions/${emoji}`, { method: 'DELETE' });
|
||||
} else {
|
||||
response = await this.request(`/api/v1/statuses/${statusId}/unreact/${encodeURIComponent(emoji)}`, { method: 'POST' });
|
||||
|
||||
@ -325,7 +325,7 @@ const getFeatures = (instance: Instance) => {
|
||||
*/
|
||||
createStatusExplicitAddressing: any([
|
||||
v.software === DITTO,
|
||||
v.software === PLEROMA,
|
||||
instance.api_versions['explicit_addressing.pleroma.pl-api'] >= 1,
|
||||
]),
|
||||
|
||||
/**
|
||||
@ -352,7 +352,6 @@ const getFeatures = (instance: Instance) => {
|
||||
* Ability to add non-standard reactions to a status.
|
||||
*/
|
||||
customEmojiReacts: any([
|
||||
instance.api_versions['custom_emoji_reactions.pleroma.pl-api'] >= 1,
|
||||
instance.api_versions['custom_emoji_reactions.pleroma.pl-api'] >= 1,
|
||||
v.software === PLEROMA && gte(v.version, '2.6.0'),
|
||||
]),
|
||||
@ -373,7 +372,7 @@ const getFeatures = (instance: Instance) => {
|
||||
* @see PATCH /api/v1/pleroma/admin/domains/:id
|
||||
* @see DELETE /api/v1/pleroma/admin/domains/:id
|
||||
*/
|
||||
domains: any([instance?.pleroma.metadata.multitenancy.enabled]),
|
||||
domains: any([instance.pleroma.metadata.multitenancy.enabled]),
|
||||
|
||||
/**
|
||||
* Ability to edit profile information.
|
||||
@ -868,9 +867,9 @@ const getFeatures = (instance: Instance) => {
|
||||
v.software === FIREFISH,
|
||||
v.software === ICESHRIMP,
|
||||
v.software === MASTODON,
|
||||
v.software === PLEROMA,
|
||||
v.software === TAKAHE && gte(v.version, '0.8.0'),
|
||||
v.software === GOTOSOCIAL,
|
||||
instance.api_versions['polls.pleroma.pl-api'] >= 1,
|
||||
]),
|
||||
|
||||
/**
|
||||
@ -951,7 +950,7 @@ const getFeatures = (instance: Instance) => {
|
||||
v.software === FRIENDICA && gte(v.version, '2023.3.0'),
|
||||
v.software === PLEROMA && [REBASED, AKKOMA].includes(v.build!) && gte(v.version, '2.5.0'),
|
||||
instance.api_versions['quote_posting.pleroma.pl-api'] >= 1,
|
||||
instance?.feature_quote === true,
|
||||
instance.feature_quote === true,
|
||||
]),
|
||||
|
||||
/**
|
||||
@ -1118,7 +1117,7 @@ const getFeatures = (instance: Instance) => {
|
||||
translations: any([
|
||||
instance.api_versions['translation.pleroma.pl-api'] >= 1,
|
||||
instance.api_versions['machine_translation.akkoma.pl-api'] >= 1,
|
||||
instance?.configuration.translation.enabled,
|
||||
instance.configuration.translation.enabled,
|
||||
]),
|
||||
|
||||
/**
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pl-api",
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.31",
|
||||
"type": "module",
|
||||
"homepage": "https://github.com/mkljczk/pl-fe/tree/fork/packages/pl-api",
|
||||
"repository": {
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
"multiselect-react-dropdown": "^2.0.25",
|
||||
"object-to-formdata": "^4.5.1",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pl-api": "^0.0.30",
|
||||
"pl-api": "^0.0.31",
|
||||
"postcss": "^8.4.29",
|
||||
"process": "^0.11.10",
|
||||
"punycode": "^2.1.1",
|
||||
|
||||
@ -8240,10 +8240,10 @@ pkg-types@^1.0.3:
|
||||
mlly "^1.2.0"
|
||||
pathe "^1.1.0"
|
||||
|
||||
pl-api@^0.0.30:
|
||||
version "0.0.30"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-0.0.30.tgz#4b093d9336604e3f1d38d790d9d2908fc36bfa99"
|
||||
integrity sha512-ZTrdcrLPhXQIJSK9smBoN96VngEIrFugmQvwKJPZLJfMXme+kXsV2X4GbNahSByYaoDRFZy6I4vgKicMQlSxig==
|
||||
pl-api@^0.0.31:
|
||||
version "0.0.31"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-0.0.31.tgz#63720a2620c304e461cf758f566809b78d4ce080"
|
||||
integrity sha512-L0d7LveBpas9Et9tRePuCfcSb3nzEgbNTyVXbivV7Je+jwGCXnhXo7O7VMl+EnjjJKW+wlqfSer7Y+Db9UCXAw==
|
||||
dependencies:
|
||||
blurhash "^2.0.5"
|
||||
http-link-header "^1.1.3"
|
||||
|
||||
Reference in New Issue
Block a user