Skip to content

Commit

Permalink
Add pleroma compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffo99 committed Sep 28, 2024
1 parent 147b518 commit fde3e42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/components/compose.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import './compose.css';
import '@github/text-expander-element';

import { msg, plural, t, Trans } from '@lingui/macro';
import { plural, t, Trans } from '@lingui/macro';
import { useLingui } from '@lingui/react';
import { MenuItem } from '@szhsin/react-menu';
import { deepEqual } from 'fast-equals';
import Fuse from 'fuse.js';
import { forwardRef, memo } from 'preact/compat';
import {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'preact/hooks';
import { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';
import { useHotkeys } from 'react-hotkeys-hook';
import stringLength from 'string-length';
// import { detectAll } from 'tinyld/light';
Expand Down Expand Up @@ -43,12 +37,7 @@ import shortenNumber from '../utils/shorten-number';
import showToast from '../utils/show-toast';
import states, { saveStatus } from '../utils/states';
import store from '../utils/store';
import {
getCurrentAccount,
getCurrentAccountNS,
getCurrentInstance,
getCurrentInstanceConfiguration,
} from '../utils/store-utils';
import { getCurrentAccount, getCurrentAccountNS, getCurrentInstanceConfiguration } from '../utils/store-utils';
import supports from '../utils/supports';
import useCloseWatcher from '../utils/useCloseWatcher';
import useInterval from '../utils/useInterval';
Expand All @@ -61,6 +50,7 @@ import Loader from './loader';
import Modal from './modal';
import Status from './status';


const {
PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,
PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,
Expand Down Expand Up @@ -1155,7 +1145,9 @@ function Compose({
/>
<Icon icon={`eye-${sensitive ? 'close' : 'open'}`} />
</label>{' '}
{supports('@akkoma/post-content-type') && (
{(
supports('@akkoma/post-content-type') | supports('@pleroma/post-content-type')
) && (
<>
<label
class={`toolbar-button ${
Expand Down Expand Up @@ -1189,9 +1181,11 @@ function Compose({
<option value="text/bbcode">
<Trans>BBCode</Trans>
</option>
<option value="text/x.misskeymarkdown">
<Trans>MFM</Trans>
</option>
{supports('@akkoma/post-content-type') && (
<option value="text/x.misskeymarkdown">
<Trans>MFM</Trans>
</option>
)}
</select>
</label>{' '}
</>
Expand Down
1 change: 1 addition & 0 deletions src/utils/supports.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const platformFeatures = {
'@pixelfed/global-feed': containPixelfed,
'@pleroma/local-visibility-post': containPleroma,
'@akkoma/local-visibility-post': containAkkoma,
'@pleroma/post-content-type': containPleroma,
'@akkoma/post-content-type': containAkkoma,
};
const supportsCache = {};
Expand Down

0 comments on commit fde3e42

Please sign in to comment.