mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 18:55:44 +03:00
Add support for local instance posts
A new platform feature is defined, `@akkoma/local-only`, which is marked as present only if the string `akkoma` is found in the instance version string. If this feature is supported, a new post visibility option is added to the post compose visibility selector, "Local instance", which sets the visibility to `"local"`. The post viewer is also updated accordingly; while local-only posts could already be seen previously, they didn't have anything written in the `.extra-meta` section, and didn't display a visibility icon. The `building` icon has been selected as the symbol for "Local instance" posts, as it's already used in the main menu to denote the Local timeline.
This commit is contained in:
parent
4e5cb133d0
commit
1e1d6e40bc
4 changed files with 10 additions and 0 deletions
|
@ -1178,6 +1178,11 @@ function Compose({
|
|||
<option value="direct">
|
||||
<Trans>Private mention</Trans>
|
||||
</option>
|
||||
{supports('@akkoma/local-only') &&
|
||||
<option value="local">
|
||||
<Trans>Local instance</Trans>
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
</label>{' '}
|
||||
</div>
|
||||
|
|
|
@ -94,6 +94,7 @@ const visibilityText = {
|
|||
unlisted: msg`Unlisted`,
|
||||
private: msg`Followers only`,
|
||||
direct: msg`Private mention`,
|
||||
local: msg`Local instance`,
|
||||
};
|
||||
|
||||
const isIOS =
|
||||
|
|
|
@ -7,6 +7,8 @@ import { getCurrentInstance } from './store-utils';
|
|||
// Non-semver(?) UA string detection
|
||||
const containPixelfed = /pixelfed/i;
|
||||
const notContainPixelfed = /^(?!.*pixelfed).*$/i;
|
||||
const containAkkoma = /akkoma/i
|
||||
const notContainAkkoma = /^(?! *akkoma) *$/i
|
||||
const platformFeatures = {
|
||||
'@mastodon/lists': notContainPixelfed,
|
||||
'@mastodon/filters': notContainPixelfed,
|
||||
|
@ -20,6 +22,7 @@ const platformFeatures = {
|
|||
'@pixelfed/trending': containPixelfed,
|
||||
'@pixelfed/home-include-reblogs': containPixelfed,
|
||||
'@pixelfed/global-feed': containPixelfed,
|
||||
'@akkoma/local-only': containAkkoma,
|
||||
};
|
||||
const supportsCache = {};
|
||||
|
||||
|
|
|
@ -3,4 +3,5 @@ export default {
|
|||
unlisted: 'group',
|
||||
private: 'lock',
|
||||
direct: 'message',
|
||||
local: 'building',
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue