Merge pull request #3571 from glitch-soc/glitch-soc/merge-upstream

Merge upstream changes up to 0a369c178b
This commit is contained in:
Claire authored and GitHub committed 2026-07-07 18:00:27 +02:00
commit 5ce113c5ce
36 files changed
+313 -109

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ runs:
${{ inputs.additional-system-dependencies }}
- name: Set up Ruby
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
ruby-version: ${{ inputs.ruby-version }}
bundler-cache: true
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
bundler-cache: true
+3 -3
View File
@@ -36,7 +36,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -49,7 +49,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -62,6 +62,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
with:
category: '/language:${{matrix.language}}'
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
bundler-cache: true
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Ruby
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1
with:
bundler-cache: true
+1 -1
View File
@@ -210,7 +210,7 @@ FROM media-build AS libvips
# libvips version to compile, change with [--build-arg VIPS_VERSION="8.15.2"]
# renovate: datasource=github-releases depName=libvips packageName=libvips/libvips
ARG VIPS_VERSION=8.18.3
ARG VIPS_VERSION=8.18.4
# libvips download URL, change with [--build-arg VIPS_URL="https://github.com/libvips/libvips/releases/download"]
ARG VIPS_URL=https://github.com/libvips/libvips/releases/download
+3 -3
View File
@@ -601,7 +601,7 @@ GEM
base64
concurrent-ruby (>= 1.1.6)
mime-types (>= 3.0)
pp (0.6.3)
pp (0.6.4)
prettyprint
premailer (1.29.0)
addressable
@@ -646,7 +646,7 @@ GEM
base64 (>= 0.1.0)
logger (>= 1.6.0)
rack (>= 3.0.0, < 4)
rack-proxy (0.8.2)
rack-proxy (0.8.3)
rack
rack-session (2.1.2)
base64 (>= 0.1.0)
@@ -905,7 +905,7 @@ GEM
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
vite_rails (3.11.0)
vite_rails (3.11.1)
railties (>= 5.1, < 9)
vite_ruby (~> 3.0, >= 3.2.2)
vite_ruby (3.10.2)
@@ -51,7 +51,7 @@ module Admin
end
def set_collection
@collection = @account.collections.includes(accepted_collection_items: :account).find(params[:id])
@collection = @account.collections.includes(accepted_collection_items: { account: [:account_stat, user: [:ips, :invite_request]] }).find(params[:id])
end
def set_collections
@@ -15,6 +15,7 @@ import { useEmoji } from './emojis';
import { importFetchedAccounts, importFetchedStatus } from './importer';
import { openModal } from './modal';
import { updateTimeline } from './timelines';
import { insertStatusIntoAccountTimelines } from './timelines_typed';
/** @type {AbortController | undefined} */
let fetchComposeSuggestionsAccountsController;
@@ -206,14 +207,14 @@ export function directCompose(account) {
*/
export function submitCompose(overridePrivacy = null, successCallback = undefined) {
return function (dispatch, getState) {
let status = getState().getIn(['compose', 'text'], '');
const media = getState().getIn(['compose', 'media_attachments']);
const statusId = getState().getIn(['compose', 'id'], null);
const hasQuote = !!getState().getIn(['compose', 'quoted_status_id']);
const spoilers = getState().getIn(['compose', 'spoiler']) || getState().getIn(['local_settings', 'always_show_spoilers_field']);
const statusText = getState().getIn(['compose', 'text'], '');
const media = getState().getIn(['compose', 'media_attachments']);
const statusId = getState().getIn(['compose', 'id'], null);
const hasQuote = !!getState().getIn(['compose', 'quoted_status_id']);
const spoilers = getState().getIn(['compose', 'spoiler']) || getState().getIn(['local_settings', 'always_show_spoilers_field']);
const spoiler_text = spoilers ? getState().getIn(['compose', 'spoiler_text'], '') : '';
const fulltext = `${spoiler_text ?? ''}${countableText(status ?? '')}`;
const fulltext = `${spoiler_text ?? ''}${countableText(statusText ?? '')}`;
const hasText = fulltext.trim().length > 0;
if (!(hasText || media.size !== 0 || (hasQuote && spoiler_text?.length))) {
@@ -252,7 +253,7 @@ export function submitCompose(overridePrivacy = null, successCallback = undefine
url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`,
method: statusId === null ? 'post' : 'put',
data: {
status,
status: statusText,
spoiler_text,
content_type: getState().getIn(['compose', 'content_type']),
local_only: getState().getIn(['compose', 'advanced_options', 'do_not_federate']),
@@ -276,7 +277,7 @@ export function submitCompose(overridePrivacy = null, successCallback = undefine
browserHistory.goBack();
}
dispatch(insertIntoTagHistory(response.data.tags, status));
dispatch(insertIntoTagHistory(response.data.tags, statusText));
dispatch(submitComposeSuccess({ ...response.data }));
if (typeof successCallback === 'function') {
successCallback(response.data);
@@ -309,6 +310,8 @@ export function submitCompose(overridePrivacy = null, successCallback = undefine
insertIfOnline('direct');
}
dispatch(insertStatusIntoAccountTimelines({ ...response.data }));
if (getState().getIn(['local_settings', 'show_published_toast'])) {
dispatch(showAlert({
message: statusId === null ? messages.published : messages.saved,
@@ -3,6 +3,7 @@ import type { List as ImmutableList, Map as ImmutableMap } from 'immutable';
import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
import type { ApiStatusJSON } from '../api_types/statuses';
import type { Status } from '../models/status';
import { createAppThunk } from '../store/typed_functions';
@@ -10,6 +11,7 @@ import {
expandTimeline,
insertIntoTimeline,
TIMELINE_NON_STATUS_MARKERS,
updateTimeline,
} from './timelines';
export const expandTimelineByKey = createAppThunk(
@@ -208,6 +210,34 @@ export const timelineDeleteStatus = createAction<{
timelineKey: string;
}>('timelines/deleteStatus');
export const insertStatusIntoAccountTimelines = createAppThunk(
(status: ApiStatusJSON, { dispatch, getState }) => {
const currentAccountId = getState().meta.get('me', null) as string | null;
if (!currentAccountId) {
return;
}
const tags = status.tags.map((tag) => tag.name);
const timelines = getState().timelines as ImmutableMap<string, unknown>;
const accountTimelines = timelines.filter((_, key) => {
if (!key.startsWith(`account:${currentAccountId}:`)) {
return false;
}
const parsed = parseTimelineKey(key);
if (parsed?.type !== 'account' || parsed.pinned) {
return false;
}
return !parsed.tagged || tags.includes(parsed.tagged);
});
accountTimelines.forEach((_, timelineKey) => {
dispatch(updateTimeline(timelineKey, status));
});
},
);
export const insertPinnedStatusIntoTimelines = createAppThunk(
(status: Status, { dispatch, getState }) => {
const currentAccountId = getState().meta.get('me', null) as string | null;
@@ -235,7 +235,7 @@ const CarouselSlideWrapper = <SlideProps extends CarouselSlideProps>({
className={className}
role='group'
aria-roledescription='slide'
inert={active}
inert={!active}
data-index={index}
>
{children}
@@ -109,15 +109,15 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
}));
};
const updateTimeline = (state, timeline, status, usePendingItems, filtered) => {
const updateTimeline = (state, timeline, statusId, usePendingItems, filtered) => {
const top = state.getIn([timeline, 'top']);
if (usePendingItems || !state.getIn([timeline, 'pendingItems']).isEmpty()) {
if (state.getIn([timeline, 'pendingItems'], ImmutableList()).includes(status.get('id')) || state.getIn([timeline, 'items'], ImmutableList()).includes(status.get('id'))) {
if (state.getIn([timeline, 'pendingItems'], ImmutableList()).includes(statusId) || state.getIn([timeline, 'items'], ImmutableList()).includes(statusId)) {
return state;
}
state = state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(status.get('id'))));
state = state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(statusId)));
if (!filtered) {
state = state.updateIn([timeline, 'unread'], unread => unread + 1);
@@ -127,7 +127,7 @@ const updateTimeline = (state, timeline, status, usePendingItems, filtered) => {
}
const ids = state.getIn([timeline, 'items'], ImmutableList());
const includesId = ids.includes(status.get('id'));
const includesId = ids.includes(statusId);
const unread = state.getIn([timeline, 'unread'], 0);
if (includesId) {
@@ -139,7 +139,7 @@ const updateTimeline = (state, timeline, status, usePendingItems, filtered) => {
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => {
if (!top && !filtered) mMap.set('unread', unread + 1);
if (top && ids.size > 40) newIds = newIds.take(20);
mMap.set('items', newIds.unshift(status.get('id')));
mMap.set('items', newIds.unshift(statusId));
}));
};
@@ -219,7 +219,7 @@ export default function timelines(state = initialState, action) {
case TIMELINE_EXPAND_SUCCESS:
return expandNormalizedTimeline(state, action.timeline, fromJS(action.statuses), action.next, action.partial, action.isLoadingRecent, action.usePendingItems);
case TIMELINE_UPDATE:
return updateTimeline(state, action.timeline, fromJS(action.status), action.usePendingItems, action.filtered);
return updateTimeline(state, action.timeline, action.status.id, action.usePendingItems, action.filtered);
case TIMELINE_CLEAR:
return clearTimeline(state, action.timeline);
case TIMELINE_SCROLL_TOP:
@@ -9,13 +9,15 @@ describe('relativeTimeParts', () => {
// Past
[-30 * SECOND, { value: -30, unit: 'second' }],
[-90 * SECOND, { value: -2, unit: 'minute' }],
[-60 * SECOND, { value: -1, unit: 'minute' }],
[-90 * SECOND, { value: -1, unit: 'minute' }],
[-30 * MINUTE, { value: -30, unit: 'minute' }],
[-90 * MINUTE, { value: -2, unit: 'hour' }],
[-60 * MINUTE, { value: -1, unit: 'hour' }],
[-90 * MINUTE, { value: -1, unit: 'hour' }],
[-5 * HOUR, { value: -5, unit: 'hour' }],
[-24 * HOUR, { value: -1, unit: 'day' }],
[-36 * HOUR, { value: -1, unit: 'day' }],
[-47 * HOUR, { value: -2, unit: 'day' }],
[-47 * HOUR, { value: -1, unit: 'day' }],
[-3 * DAY, { value: -3, unit: 'day' }],
// Future
+13 -5
View File
@@ -16,21 +16,29 @@ export function relativeTimeParts(
): { value: number; unit: TimeUnit; delta: number } {
const delta = ts - now;
const absDelta = Math.abs(delta);
const sign = Math.sign(delta);
if (absDelta < MINUTE) {
return { value: Math.floor(delta / SECOND), unit: 'second', delta };
return {
value: sign * Math.floor(absDelta / SECOND),
unit: 'second',
delta,
};
}
if (absDelta < HOUR) {
return { value: Math.floor(delta / MINUTE), unit: 'minute', delta };
return {
value: sign * Math.floor(absDelta / MINUTE),
unit: 'minute',
delta,
};
}
if (absDelta < DAY) {
return { value: Math.floor(delta / HOUR), unit: 'hour', delta };
return { value: sign * Math.floor(absDelta / HOUR), unit: 'hour', delta };
}
// Round instead of use floor as days are big enough that the value is usually off by a few hours.
return { value: Math.round(delta / DAY), unit: 'day', delta };
return { value: sign * Math.floor(absDelta / DAY), unit: 'day', delta };
}
export function isToday(ts: number, now = Date.now()): boolean {
+10 -7
View File
@@ -14,6 +14,7 @@ import { useEmoji } from './emojis';
import { importFetchedAccounts, importFetchedStatus } from './importer';
import { openModal } from './modal';
import { updateTimeline } from './timelines';
import { insertStatusIntoAccountTimelines } from './timelines_typed';
/** @type {AbortController | undefined} */
let fetchComposeSuggestionsAccountsController;
@@ -189,13 +190,13 @@ export function directCompose(account) {
export function submitCompose(successCallback) {
return function (dispatch, getState) {
const status = getState().getIn(['compose', 'text'], '');
const media = getState().getIn(['compose', 'media_attachments']);
const statusId = getState().getIn(['compose', 'id'], null);
const hasQuote = !!getState().getIn(['compose', 'quoted_status_id']);
const statusText = getState().getIn(['compose', 'text'], '');
const media = getState().getIn(['compose', 'media_attachments']);
const statusId = getState().getIn(['compose', 'id'], null);
const hasQuote = !!getState().getIn(['compose', 'quoted_status_id']);
const spoiler_text = getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '';
const fulltext = `${spoiler_text ?? ''}${countableText(status ?? '')}`;
const fulltext = `${spoiler_text ?? ''}${countableText(statusText ?? '')}`;
const hasText = fulltext.trim().length > 0;
if (!(hasText || media.size !== 0 || (hasQuote && spoiler_text?.length))) {
@@ -234,7 +235,7 @@ export function submitCompose(successCallback) {
url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`,
method: statusId === null ? 'post' : 'put',
data: {
status,
status: statusText,
spoiler_text,
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
media_ids: media.map(item => item.get('id')),
@@ -254,7 +255,7 @@ export function submitCompose(successCallback) {
browserHistory.goBack();
}
dispatch(insertIntoTagHistory(response.data.tags, status));
dispatch(insertIntoTagHistory(response.data.tags, statusText));
dispatch(submitComposeSuccess({ ...response.data }));
if (typeof successCallback === 'function') {
successCallback(response.data);
@@ -286,6 +287,8 @@ export function submitCompose(successCallback) {
insertIfOnline(`account:${response.data.account.id}`);
}
dispatch(insertStatusIntoAccountTimelines({ ...response.data }))
dispatch(showAlert({
message: statusId === null ? messages.published : messages.saved,
action: messages.open,
@@ -3,6 +3,7 @@ import type { List as ImmutableList, Map as ImmutableMap } from 'immutable';
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
import type { ApiStatusJSON } from '../api_types/statuses';
import type { Status } from '../models/status';
import { createAppThunk } from '../store/typed_functions';
@@ -10,6 +11,7 @@ import {
expandTimeline,
insertIntoTimeline,
TIMELINE_NON_STATUS_MARKERS,
updateTimeline,
} from './timelines';
export const expandTimelineByKey = createAppThunk(
@@ -208,6 +210,34 @@ export const timelineDeleteStatus = createAction<{
timelineKey: string;
}>('timelines/deleteStatus');
export const insertStatusIntoAccountTimelines = createAppThunk(
(status: ApiStatusJSON, { dispatch, getState }) => {
const currentAccountId = getState().meta.get('me', null) as string | null;
if (!currentAccountId) {
return;
}
const tags = status.tags.map((tag) => tag.name);
const timelines = getState().timelines as ImmutableMap<string, unknown>;
const accountTimelines = timelines.filter((_, key) => {
if (!key.startsWith(`account:${currentAccountId}:`)) {
return false;
}
const parsed = parseTimelineKey(key);
if (parsed?.type !== 'account' || parsed.pinned) {
return false;
}
return !parsed.tagged || tags.includes(parsed.tagged);
});
accountTimelines.forEach((_, timelineKey) => {
dispatch(updateTimeline(timelineKey, status));
});
},
);
export const insertPinnedStatusIntoTimelines = createAppThunk(
(status: Status, { dispatch, getState }) => {
const currentAccountId = getState().meta.get('me', null) as string | null;
@@ -235,7 +235,7 @@ const CarouselSlideWrapper = <SlideProps extends CarouselSlideProps>({
className={className}
role='group'
aria-roledescription='slide'
inert={active}
inert={!active}
data-index={index}
>
{children}
+3
View File
@@ -1231,6 +1231,7 @@
"status.block": "Blokovat @{name}",
"status.bookmark": "Přidat do záložek",
"status.cancel_reblog_private": "Zrušit boostnutí",
"status.cannot_edit": "Nemáte oprávněni upravit tento příspěvek",
"status.cannot_quote": "Nemáte oprávnění citovat tento příspěvek",
"status.cannot_reblog": "Tento příspěvek nemůže být boostnutý",
"status.contains_quote": "Obsahuje citaci",
@@ -1264,8 +1265,10 @@
"status.more": "Více",
"status.mute": "Skrýt @{name}",
"status.mute_conversation": "Skrýt konverzaci",
"status.not_quoted": "V tomto příspěvku nejste citováni",
"status.open": "Rozbalit tento příspěvek",
"status.pin": "Připnout na profil",
"status.public_only": "Tento příspěvek je soukromý",
"status.quote": "Citovat",
"status.quote.cancel": "Zrušit citování",
"status.quote_error.blocked_account_hint.title": "Tento příspěvek je skryt, protože jste zablokovali @{name}.",
+4
View File
@@ -267,6 +267,7 @@
"admin.impact_report.instance_followers": "Ακόλουθοι που θα χάσουν οι χρήστες μας",
"admin.impact_report.instance_follows": "Ακόλουθοι που θα χάσουν οι χρήστες τους",
"admin.impact_report.title": "Περίληψη επιπτώσεων",
"alert.need_reload.message": "Το Mastodon έχει ενημερωθεί. Κάποια πράγματα ενδέχεται να μην λειτουργούν σωστά μέχρι να φορτώσετε ξανά τη σελίδα.",
"alert.rate_limited.message": "Παρακαλούμε δοκίμασε ξανά μετά τις {retry_time, time, medium}",
"alert.rate_limited.title": "Περιορισμός συχνότητας",
"alert.unexpected.message": "Προέκυψε απροσδόκητο σφάλμα.",
@@ -1230,6 +1231,7 @@
"status.block": "Αποκλεισμός @{name}",
"status.bookmark": "Σελιδοδείκτης",
"status.cancel_reblog_private": "Ακύρωση ενίσχυσης",
"status.cannot_edit": "Δεν επιτρέπεται να επεξεργαστείτε αυτήν την ανάρτηση",
"status.cannot_quote": "Δεν επιτρέπεται να παραθέσετε αυτή την ανάρτηση",
"status.cannot_reblog": "Αυτή η ανάρτηση δεν μπορεί να ενισχυθεί",
"status.contains_quote": "Περιέχει παράθεση",
@@ -1263,8 +1265,10 @@
"status.more": "Περισσότερα",
"status.mute": "Σίγαση @{name}",
"status.mute_conversation": "Σίγαση συνομιλίας",
"status.not_quoted": "Δεν παρατίθεστε σε αυτήν την ανάρτηση",
"status.open": "Επέκταση ανάρτησης",
"status.pin": "Καρφίτσωσε στο προφίλ",
"status.public_only": "Αυτή η ανάρτηση είναι ιδιωτική",
"status.quote": "Παράθεση",
"status.quote.cancel": "Ακύρωση παράθεσης",
"status.quote_error.blocked_account_hint.title": "Αυτή η ανάρτηση είναι κρυμμένη επειδή έχετε μπλοκάρει τον/την @{name}.",
+3
View File
@@ -1231,6 +1231,7 @@
"status.block": "Blokker @{name}",
"status.bookmark": "Set bokmerke",
"status.cancel_reblog_private": "Opphev framheving",
"status.cannot_edit": "Du har ikkje løyve til å endra dette innlegget",
"status.cannot_quote": "Du har ikkje løyve til å sitera dette innlegget",
"status.cannot_reblog": "Du kan ikkje framheva dette innlegget",
"status.contains_quote": "Inneheld eit sitat",
@@ -1264,8 +1265,10 @@
"status.more": "Meir",
"status.mute": "Demp @{name}",
"status.mute_conversation": "Demp samtale",
"status.not_quoted": "Du er ikkje sitert i dette innlegget",
"status.open": "Utvid denne statusen",
"status.pin": "Fest på profil",
"status.public_only": "Dette innlegget er privat",
"status.quote": "Siter",
"status.quote.cancel": "Avbryt siteringa",
"status.quote_error.blocked_account_hint.title": "Dette innlegget er gøymt fordi du har blokkert @{name}.",
+2
View File
@@ -1265,8 +1265,10 @@
"status.more": "Daha fazla",
"status.mute": "@{name} kişisini sessize al",
"status.mute_conversation": "Sohbeti sessize al",
"status.not_quoted": "Bu gönderide sizden alıntı yapılmamıştır",
"status.open": "Bu gönderiyi genişlet",
"status.pin": "Profile sabitle",
"status.public_only": "Bu gönderi gizlidir",
"status.quote": "Teklif",
"status.quote.cancel": "Teklifi iptal et",
"status.quote_error.blocked_account_hint.title": "Bu gönderi @{name} kişisini engellediğiniz için gizlenmiştir.",
@@ -109,19 +109,19 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
}));
};
const updateTimeline = (state, timeline, status, usePendingItems) => {
const updateTimeline = (state, timeline, statusId, usePendingItems) => {
const top = state.getIn([timeline, 'top']);
if (usePendingItems || !state.getIn([timeline, 'pendingItems']).isEmpty()) {
if (state.getIn([timeline, 'pendingItems'], ImmutableList()).includes(status.get('id')) || state.getIn([timeline, 'items'], ImmutableList()).includes(status.get('id'))) {
if (state.getIn([timeline, 'pendingItems'], ImmutableList()).includes(statusId) || state.getIn([timeline, 'items'], ImmutableList()).includes(statusId)) {
return state;
}
return state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(status.get('id'))).update('unread', unread => unread + 1));
return state.update(timeline, initialTimeline, map => map.update('pendingItems', list => list.unshift(statusId)).update('unread', unread => unread + 1));
}
const ids = state.getIn([timeline, 'items'], ImmutableList());
const includesId = ids.includes(status.get('id'));
const includesId = ids.includes(statusId);
const unread = state.getIn([timeline, 'unread'], 0);
if (includesId) {
@@ -133,7 +133,7 @@ const updateTimeline = (state, timeline, status, usePendingItems) => {
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => {
if (!top) mMap.set('unread', unread + 1);
if (top && ids.size > 40) newIds = newIds.take(20);
mMap.set('items', newIds.unshift(status.get('id')));
mMap.set('items', newIds.unshift(statusId));
}));
};
@@ -213,7 +213,7 @@ export default function timelines(state = initialState, action) {
case TIMELINE_EXPAND_SUCCESS:
return expandNormalizedTimeline(state, action.timeline, fromJS(action.statuses), action.next, action.partial, action.isLoadingRecent, action.usePendingItems);
case TIMELINE_UPDATE:
return updateTimeline(state, action.timeline, fromJS(action.status), action.usePendingItems);
return updateTimeline(state, action.timeline, action.status.id, action.usePendingItems);
case TIMELINE_CLEAR:
return clearTimeline(state, action.timeline);
case TIMELINE_SCROLL_TOP:
+5 -3
View File
@@ -9,13 +9,15 @@ describe('relativeTimeParts', () => {
// Past
[-30 * SECOND, { value: -30, unit: 'second' }],
[-90 * SECOND, { value: -2, unit: 'minute' }],
[-60 * SECOND, { value: -1, unit: 'minute' }],
[-90 * SECOND, { value: -1, unit: 'minute' }],
[-30 * MINUTE, { value: -30, unit: 'minute' }],
[-90 * MINUTE, { value: -2, unit: 'hour' }],
[-60 * MINUTE, { value: -1, unit: 'hour' }],
[-90 * MINUTE, { value: -1, unit: 'hour' }],
[-5 * HOUR, { value: -5, unit: 'hour' }],
[-24 * HOUR, { value: -1, unit: 'day' }],
[-36 * HOUR, { value: -1, unit: 'day' }],
[-47 * HOUR, { value: -2, unit: 'day' }],
[-47 * HOUR, { value: -1, unit: 'day' }],
[-3 * DAY, { value: -3, unit: 'day' }],
// Future
+13 -5
View File
@@ -16,21 +16,29 @@ export function relativeTimeParts(
): { value: number; unit: TimeUnit; delta: number } {
const delta = ts - now;
const absDelta = Math.abs(delta);
const sign = Math.sign(delta);
if (absDelta < MINUTE) {
return { value: Math.floor(delta / SECOND), unit: 'second', delta };
return {
value: sign * Math.floor(absDelta / SECOND),
unit: 'second',
delta,
};
}
if (absDelta < HOUR) {
return { value: Math.floor(delta / MINUTE), unit: 'minute', delta };
return {
value: sign * Math.floor(absDelta / MINUTE),
unit: 'minute',
delta,
};
}
if (absDelta < DAY) {
return { value: Math.floor(delta / HOUR), unit: 'hour', delta };
return { value: sign * Math.floor(absDelta / HOUR), unit: 'hour', delta };
}
// Round instead of use floor as days are big enough that the value is usually off by a few hours.
return { value: Math.round(delta / DAY), unit: 'day', delta };
return { value: sign * Math.floor(absDelta / DAY), unit: 'day', delta };
}
export function isToday(ts: number, now = Date.now()): boolean {
+24
View File
@@ -19,6 +19,9 @@ class Multibase
bytes.pack('C*')
end.freeze
ED25519_PUB_DER_HEADER = ['302a300506032b6570032100'].pack('H*').freeze
ML_DSA_44_PUB_DER_HEADER = ['30820532300b06096086480165030403110382052100'].pack('H*').freeze
def self.decode(string)
raise ArgumentError if string.nil?
@@ -41,4 +44,25 @@ class Multibase
raise ArgumentError
end
def self.decode_key_to_pem(string)
tag, binary = decode_multicodec(string)
case tag
when :'rsa-pub'
[:rsa, OpenSSL::PKey::RSA.new(binary).to_pem]
when :'ed25519-pub'
raise ArgumentError unless binary.size == 32
der = ED25519_PUB_DER_HEADER + binary
[:ed25519, "-----BEGIN PUBLIC KEY-----\n#{Base64.strict_encode64(der)}\n-----END PUBLIC KEY-----\n"]
when :'mldsa-44-pub'
raise ArgumentError unless binary.size == 1312
der = ML_DSA_44_PUB_DER_HEADER + binary
[:'ml-dsa-44', "-----BEGIN PUBLIC KEY-----\n#{Base64.strict_encode64(der).scan(/.{,64}/).join("\n")}-----END PUBLIC KEY-----\n"]
else
raise ArgumentError
end
end
end
@@ -334,20 +334,7 @@ class ActivityPub::ProcessAccountService < BaseService
end
def key_from_multikey(value)
tag, key = Multibase.decode_multicodec(value)
case tag
when :'rsa-pub'
[:rsa, OpenSSL::PKey::RSA.new(key).to_pem]
when :'ed25519-pub'
asn1 = OpenSSL::ASN1::Sequence(
[
OpenSSL::ASN1::Sequence([OpenSSL::ASN1::ObjectId('ED25519')]),
OpenSSL::ASN1::BitString(key),
]
)
[:ed25519, OpenSSL::PKey.read(asn1.to_der).public_to_pem]
end
Multibase.decode_key_to_pem(value)
rescue ArgumentError
nil
end
+107
View File
@@ -1017,6 +1017,7 @@ cs:
overview_html: Stránka zobrazující popis serveru vedle nejnovějších lokálních příspěvků uživatelů na tomto serveru.
trends_html: Stránka, která zobrazuje, co je teď na tomto serveru populární.
values:
about: Informační stránka
local_feed: Místní živý kanál
overview: Přehled
trends: Populární
@@ -1274,6 +1275,7 @@ cs:
other: Použit %{count} lidmi za poslední týden
title: Doporučení & Trendy
trending: Populární
update_available: Je dostupná aktualizace
username_blocks:
add_new: Přidat
block_registrations: Blokovat registrace
@@ -1429,6 +1431,7 @@ cs:
progress:
confirm: Potvrdit e-mail
details: Vaše údaje
list: Proces registrace
review: Naše hodnocení
rules: Přijmout pravidla
providers:
@@ -1444,6 +1447,7 @@ cs:
invited_by: 'Můžete se připojit k %{domain} díky pozvánce, kterou jste obdrželi od:'
preamble: Tohle nastavují a prosazují moderátoři %{domain}.
preamble_invited: Než budete pokračovat, vezměte prosím v úvahu základní pravidla stanovená moderátory %{domain}.
read_more: Zobrazit více
title: Některá základní pravidla.
title_invited: Byl/a jsi pozván/a.
security: Zabezpečení
@@ -1563,6 +1567,46 @@ cs:
your_appeal_rejected: Vaše odvolání bylo zamítnuto
edit_profile:
other: Další
privacy_redesign_body: Možnost zobrazit sledované a sledující je nyní možno nastavit přímo ve vašem profilu.
redesign_body: Úprava profilu je nyní dostupná přímo z profilové stránky.
redesign_button: Začít
redesign_title: K dispozici je nové prostředí pro úpravu profilu
email_subscription_mailer:
confirmation:
action: Potvrdit emailovou adresu
instructions_to_confirm: Potvrďte, že chcete dostávat e-maily od %{name} (@%{acct}), když publikují nové příspěvky.
instructions_to_ignore: Pokud si nejste jisti, proč jste obdrželi tento e-mail, můžete jej smazat. Nebudete přihlášeni, pokud nekliknete na odkaz výše.
subject: Potvrďte svou e-mailovou adresu
title: Dostávat e-mailem novinky od %{name}?
notification:
create_account: Vytvořit Mastodon účet
footer:
privacy_html: E-maily jsou odesílány z %{domain}, serveru poháněného Mastodonem. Pro, jak tento server zpracovává vaše osobní údaje, se podívejte na <a href="%{privacy_policy_path}">Zásady ochrany osobních údajů</a>.
reason_for_email_html: Obdrželi jste tento e-mail, protože jste se přihlásili k e-mailovým aktualizacím od %{name}. Nechcete dostávat tyto e-maily? <a href="%{unsubscribe_path}">Odhlásit se</a>
interact_with_this_post:
few: Interagujte s těmito příspěvky a objevujte více.
many: Interagujte s těmito příspěvky a objevujte více.
one: Interagujte s tímto příspěvkem a objevte jemu podobné.
other: Interagujte s těmito příspěvky a objevujte více.
subject:
plural: Nové příspěvky od %{name}
singular: 'Nový příspěvek: „%{excerpt}“'
title:
plural: Nové příspěvky od %{name}
singular: 'Nový příspěvek: „%{excerpt}“'
email_subscriptions:
active: Aktivní
confirmations:
show:
changed_your_mind: Rozmysleli jste si to?
success_html: Nyní začnete dostávat e-maily, když %{name} publikuje nové příspěvky. Přidejte %{sender} do svých kontaktů, aby tyto příspěvky neskončily ve složce nevyžádané pošty.
title: Jste přihlášeni
unsubscribe: Odhlásit odběr
disabled: Vypnuto
inactive: Neaktivní
no_access: Bez přístupu
status: Stav
subscribers: Odběratelé
emoji_styles:
auto: Auto
native: Výchozí
@@ -1596,7 +1640,9 @@ cs:
blocks: Blokujete
bookmarks: Záložky
csv: CSV
custom_filters: Filtry
domain_blocks: Doménové blokace
json: JSON
lists: Seznamy
mutes: Skrýváte
storage: Úložiště médií
@@ -1688,7 +1734,9 @@ cs:
empty: Prázdný CSV soubor
incompatible_type: Nekompatibilní s vybraným typem importu
invalid_csv_file: 'Neplatný soubor CSV. Chyba: %{error}'
invalid_json_file: 'Neplatný JSON soubor. Chyba: %{error}'
over_rows_processing_limit: obsahuje více než %{count} řádků
status_not_found_warning: Některé z vašich filtrů skrývají specifické příspěvky, které nejsou tímto serverem známy. Tyto příspěvky nebudou automaticky filtrovány, pokud budou objeveny později.
too_large: Soubor je příliš velký
failures: Chyby
imported: Importováno
@@ -1709,6 +1757,11 @@ cs:
many: Chystáte se <strong>nahradit své záložky</strong> s <strong>%{count} příspěvky</strong> z <strong>%{filename}</strong>.
one: Chystáte se <strong>nahradit své záložky</strong> s <strong>%{count} příspěvkem</strong> z <strong>%{filename}</strong>.
other: Chystáte se <strong>nahradit své záložky</strong> s <strong>%{count} příspěvky</strong> z <strong>%{filename}</strong>.
custom_filters_html:
few: Chystáte se <strong>nahradit vaše filtry</strong> s obsahem <strong>%{filename}</strong>. K novým filtrům bude přidáno až <strong>%{count} filtrů</strong>.
many: Chystáte se <strong>nahradit vaše filtry</strong> s obsahem <strong>%{filename}</strong>. K novým filtrům bude přidáno až <strong>%{count} filtrů</strong>.
one: Chystáte se <strong>nahradit vaše filtry</strong> s obsahem <strong>%{filename}</strong>. K novým filtrům bude přidán až <strong>%{count} filtr</strong>.
other: Chystáte se <strong>nahradit vaše filtry</strong> s obsahem <strong>%{filename}</strong>. K novým filtrům bude přidáno až <strong>%{count} filtrů</strong>.
domain_blocking_html:
few: Chystáte se <strong>nahradit Váš seznam zablokovaných domén</strong> s <strong>%{count} stránky</strong> z <strong>%{filename}</strong>.
many: Chystáte se <strong>nahradit Váš seznam zablokovaných domén</strong> s <strong>%{count} stránky</strong> z <strong>%{filename}</strong>.
@@ -1740,6 +1793,11 @@ cs:
many: Chystáte se přidat až <strong>%{count} příspěvků</strong> z <strong>%{filename}</strong> do vašich <strong>záložek</strong>.
one: Chystáte se přidat až <strong>%{count} příspěvek</strong> z <strong>%{filename}</strong> do vašich <strong>záložek</strong>.
other: Chystáte se přidat až <strong>%{count} příspěvků</strong> z <strong>%{filename}</strong> do vašich <strong>záložek</strong>.
custom_filters_html:
few: Chystáte se přidat až <strong>%{count} filtrů</strong> z <strong>%{filename}</strong> do vašich <strong>filtrů</strong>.
many: Chystáte se přidat až <strong>%{count} filtrů</strong> z <strong>%{filename}</strong> do vašich <strong>filtrů</strong>.
one: Chystáte se přidat až <strong>%{count} filtr</strong> z <strong>%{filename}</strong> do vašich <strong>filtrů</strong>.
other: Chystáte se přidat až <strong>%{count} filtrů</strong> z <strong>%{filename}</strong> do vašich <strong>filtrů</strong>.
domain_blocking_html:
few: Chystáte se <strong>zablokovat</strong> až <strong>%{count} domény</strong> z <strong>%{filename}</strong>.
many: Chystáte se <strong>zablokovat</strong> až <strong>%{count} domén</strong> z <strong>%{filename}</strong>.
@@ -1784,6 +1842,7 @@ cs:
types:
blocking: Seznam blokovaných
bookmarks: Záložky
custom_filters: Filtry
domain_blocking: Seznam blokovaných domén
following: Seznam sledovaných
lists: Seznamy
@@ -1880,6 +1939,29 @@ cs:
copy_account_note_text: 'Tento účet se přesunul z %{acct}, zde byly Vaše předchozí poznámky o něm:'
navigation:
toggle_menu: Přepnout menu
notification_fallbacks:
added_to_collection:
title_html: "%{name} vás přidali do kolekce"
admin_report:
title_html: "%{name} nahlásili %{target}"
admin_sign_up:
title_and_others_html:
few: "%{name} a %{count} dalších se zaregistrovali"
many: "%{name} a %{count} dalších se zaregistrovali"
one: "%{name} a jeden další se zaregistrovali"
other: "%{name} a %{count} dalších se zaregistrovali"
title_html: "%{name} se zaregistrovali"
collection_update:
title_html: "%{name} aktualizovali sbírku, ve které se nacházíte"
generic:
sign_in: Přihlaste se do webové aplikace Mastodon
summary_html: Jste na aplikaci, která nepodporuje nejnovější verzi Mastodonu. %{link} pro plnou funkčnost.
moderation_warning:
summary_html: Jste na aplikaci, která nepodporuje nejnovější verzi Mastodonu. %{link}.
title: Obdrželi jste moderační varování.
severed_relationships:
summary_html: Administrátor z %{from} pozastavil %{target}, což znamená, že od nich již nemůžete přijímat novinky ani s nimi interagovat. %{link} pro načtení seznamu ztracených kontaktů.
title: Kontakt ztracen s %{name}
notification_mailer:
admin:
report:
@@ -1951,6 +2033,7 @@ cs:
next: Další
older: Starší
prev: Předchozí
truncate_html: "&hellip;"
polls:
errors:
already_voted: V této anketě jste již hlasovali
@@ -1971,6 +2054,8 @@ cs:
posting_defaults: Výchozí nastavení příspěvků
public_timelines: Veřejné časové osy
privacy:
email_subscriptions: Poslat příspěvky e-mailem
email_subscriptions_hint_html: Přidejte si na profil formulář pro přihlášení k odběru e-mailů, který se bude zobrazovat odhlášeným uživatelům. Jakmile návštěvníci zadají svou e-mailovou adresu a potvrdí odběr, Mastodon jim bude zasílat e-mailové upozornění o vašich veřejných příspěvcích.
hint_html: "<strong>Nastavte si, jak chcete, aby šlo váš profil a vaše příspěvky nalézt.</strong> Řada funkcí v Mastodonu vám může po zapnutí pomoci získat širší publikum. Věnujte chvíli kontrole těchto nastavení, aby vyhovovala vašim potřebám."
privacy: Soukromí
privacy_hint_html: Nastavte si, kolik toho chcete zveřejnit ve prospěch ostatních. Lidé objevují zajímavé profily a skvělé aplikace procházením sledovaných ostatních lidí i tím, že vidí, z jakých aplikací ostatní posílají příspěvky, vy se však můžete rozhodnout tyto údaje skrýt.
@@ -2242,6 +2327,28 @@ cs:
resume_app_authorization: Pokračovat v autorizaci aplikace
role_requirement: "%{domain} vyžaduje nastavení dvoufázového ověření, než budete moci použít Mastodon."
webauthn: Bezpečnostní klíče
unsubscriptions:
create:
action: Přejít na domovskou stránku serveru
email_subscription:
confirmation_html: Již nebudete dostávat e-maily od %{name}.
title: Jste odhlášeni
user:
confirmation_html: Již nebudete dostávat %{type} od Mastodonu na %{domain}.
notification_emails:
favourite: e-mailové oznámení při oblíbení
follow: e-mailové oznámení při sledování
follow_request: e-mail při žádost o sledování
mention: e-mailové oznámení při zmínění
reblog: e-mailové oznámení při boostnutí
show:
action: Odhlásit se
email_subscription:
confirmation_html: Přestanete dostávat e-maily, když tento účet publikuje nové příspěvky.
title: Odhlásit se z %{name}?
user:
confirmation_html: Přestanete dostávat %{type} z Mastodonu na %{domain}.
title: Odhlásit se z %{type}?
user_mailer:
announcement_published:
description: 'Správci %{domain} oznamují:'
+1 -1
View File
@@ -1235,7 +1235,7 @@ de:
other: In den vergangenen 7 Tagen von %{count} Profilen verwendet
title: Empfehlungen & Trends
trending: Angesagt
update_available: Update Verfügbar
update_available: Update verfügbar
username_blocks:
add_new: Neue Regel
block_registrations: Registrierungen sperren
+9
View File
@@ -289,7 +289,11 @@ el:
enable_relay_html: Ο χρήστης %{name} ενεργοποίησε το relay %{target}
enable_sign_in_token_auth_user_html: Ο χρήστης %{name} ενεργοποίησε την πιστοποίηση αναγνωριστικού email του %{target}
enable_user_html: Ο/Η %{name} ενεργοποίησε τη σύνδεση για τον χρήστη %{target}
listable_tag_html: μπορεί να προτείνεται
memorialize_account_html: O/H %{name} μετέτρεψε τον λογαριασμό του %{target} σε σελίδα εις μνήμην
not_listable_tag_html: δεν θα προτείνεται
not_trendable_tag_html: δεν θα εμφανίζεται στις τάσεις
not_usable_tag_html: δεν θα μπορεί να χρησιμοποιείται
promote_user_html: Ο/Η %{name} προβίβασε το χρήστη %{target}
publish_terms_of_service_html: Ο χρήστης %{name} δημοσίευσε ενημερώσεις για τους όρους της υπηρεσίας
reject_appeal_html: Ο/Η %{name} απέρριψε την έφεση της απόφασης των συντονιστών από %{target}
@@ -302,6 +306,7 @@ el:
sensitive_account_html: Ο/Η %{name} σήμανε τα πολυμέσα του/της %{target} ως ευαίσθητα
silence_account_html: Ο/Η %{name} περιόρισε τον λογαριασμό του/της %{target}
suspend_account_html: Ο/Η %{name} ανέστειλε τον λογαριασμό του/της %{target}
trendable_tag_html: μπορεί να εμφανίζεται στις τάσεις
unassigned_report_html: Ο/Η %{name} αποδέσμευσε την αναφορά %{target}
unblock_email_account_html: "%{name} έκανε άρση αποκλεισμού στη διεύθυνση email του %{target}"
unsensitive_account_html: Ο/Η %{name} σήμανε τα πολυμέσα του/της %{target} ως μη ευαίσθητα
@@ -314,8 +319,10 @@ el:
update_ip_block_html: Ο/Η %{name} άλλαξε τον κανόνα για την IP %{target}
update_report_html: Ο χρήστης %{name} ενημέρωσε την αναφορά %{target}
update_status_html: Ο/Η %{name} ενημέρωσε την ανάρτηση του/της %{target}
update_tag_html: 'Ο/Η %{name} άλλαξε τις ρυθμίσεις %{target} σε: '
update_user_role_html: Ο/Η %{name} άλλαξε τον ρόλο %{target}
update_username_block_html: "%{name} ενημέρωσε κανόνα για ονόματα χρηστών που περιέχουν %{target}"
usable_tag_html: μπορεί να χρησιμοποιείται,
deleted_account: λογαριασμός διαγράφηκε
empty: Δεν βρέθηκαν αρχεία καταγραφής.
filter_by_action: Φιλτράρισμα ανά ενέργεια
@@ -1228,6 +1235,7 @@ el:
other: Χρησιμοποιήθηκε από %{count} άτομα την τελευταία εβδομάδα
title: Προτάσεις και τάσεις
trending: Τάσεις
update_available: Διαθέσιμη ενημέρωση
username_blocks:
add_new: Προσθήκη νέου
block_registrations: Φραγή εγγραφών
@@ -1935,6 +1943,7 @@ el:
next: Επόμενη
older: Παλαιότερες
prev: Προηγούμενη
truncate_html: "&hellip;"
polls:
errors:
already_voted: Έχετε ήδη ψηφίσει σε αυτή τη δημοσκόπηση
+1 -1
View File
@@ -1237,7 +1237,7 @@ fr-CA:
trending: Tendances
update_available: Mise à jour disponible
username_blocks:
add_new: Ajouter un nouveau
add_new: Ajouter une règle
block_registrations: Bloquer les inscriptions
comparison:
contains: Contient
+2 -2
View File
@@ -1229,7 +1229,7 @@ fr:
trendable: Peut apparaître sous les tendances
trending_rank: 'Tendance #%{rank}'
usable: Peut être utilisé
usage_comparison: Utilisé %{today} fois aujourd'hui, comparé à %{yesterday} hier
usage_comparison: Utilisé %{today} fois aujourd'hui, et %{yesterday} fois hier
used_by_over_week:
one: Utilisé par %{count} personne au cours de la dernière semaine
other: Utilisé par %{count} personnes au cours de la dernière semaine
@@ -1237,7 +1237,7 @@ fr:
trending: Tendances
update_available: Mise à jour disponible
username_blocks:
add_new: Ajouter un nouveau
add_new: Ajouter une règle
block_registrations: Bloquer les inscriptions
comparison:
contains: Contient
+1
View File
@@ -1235,6 +1235,7 @@ nn:
other: Brukt av %{count} personer i løpet av den seneste uken
title: Tilrådingar og trendar
trending: Trender
update_available: Ei oppdatering er tilgjengeleg
username_blocks:
add_new: Lag ny
block_registrations: Blokker registreringar
+1
View File
@@ -1235,6 +1235,7 @@ tr:
other: Geçen hafta %{count} kişi tarafından kullanıldı
title: Öneriler ve Öne Çıkanlar
trending: Öne çıkanlar
update_available: Güncelleme var
username_blocks:
add_new: Yeni ekle
block_registrations: Kayıtları engelle
+2 -2
View File
@@ -506,7 +506,7 @@ zh-CN:
show:
confirm_disable_feature: 禁用 %{name} 的邮件电子报吗?此后将不再执行此账号的电子邮件推送。该用户仍可以在账号设置中重新启用此功能。要永久移除此功能的访问权限,请在“角色”设置中编辑账号权限。
confirm_remove_subscriber: "%{email} 将不会再收到来自 %{name} 的电子邮件。此操作无法撤销。"
consent: 此列表中的订阅者仅同意通过电子邮件接受嘟文。请不要将此列表用作其他目的。
consent: 此列表中的订阅者仅同意通过电子邮件接收嘟文。请不要将此列表用作其他目的。
date: 订阅注册日期
disable_feature: 禁用功能
disabled: 此功能已被禁用,邮件已不再向此列表内发送。
@@ -549,7 +549,7 @@ zh-CN:
index:
disabled:
cannot_be_enabled: 你的技术提供商尚未为你的服务器启用此功能。
description: 此功能允许指定账号在个人资料页添加小组件,使没有 Mastodon 账号的访客也能通过电子邮件接受此账号的嘟文。
description: 此功能允许指定账号在个人资料页添加小组件,使没有 Mastodon 账号的访客也能通过电子邮件接收此账号的嘟文。
get_started: 开始使用
lead: 允许访客通过电子邮件接收此服务器上指定账号的内容。
title: 邮件电子报
+1 -1
View File
@@ -76,7 +76,7 @@ module ViteRails::TagHelpers::IntegrityExtension
skip_preload_tags: false,
skip_style_tags: false,
crossorigin: '',
media: 'screen',
media: nil,
**options)
entries = vite_manifest.resolve_entries_with_integrity(*names, type: asset_type)
@@ -47,15 +47,9 @@ RSpec.describe ActivityPub::ObjectIntegrityProof do
context 'when the signature is correct' do
before do
asn1 = OpenSSL::ASN1::Sequence(
[
OpenSSL::ASN1::Sequence([OpenSSL::ASN1::ObjectId('ED25519')]),
OpenSSL::ASN1::BitString(Multibase.decode_multicodec('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')[1]),
]
)
keypair = OpenSSL::PKey.read(asn1.to_der)
_, pem = Multibase.decode_key_to_pem('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')
Fabricate(:keypair, account: actor, uri: 'https://server.example/users/alice#ed25519-key', type: :ed25519, public_key: keypair.public_to_pem)
Fabricate(:keypair, account: actor, uri: 'https://server.example/users/alice#ed25519-key', type: :ed25519, public_key: pem)
end
it 'returns the actor' do
@@ -108,15 +102,9 @@ RSpec.describe ActivityPub::ObjectIntegrityProof do
end
before do
asn1 = OpenSSL::ASN1::Sequence(
[
OpenSSL::ASN1::Sequence([OpenSSL::ASN1::ObjectId('ED25519')]),
OpenSSL::ASN1::BitString(Multibase.decode_multicodec('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')[1]),
]
)
keypair = OpenSSL::PKey.read(asn1.to_der)
_, pem = Multibase.decode_key_to_pem('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')
Fabricate(:keypair, account: actor, uri: 'https://server.example/users/alice#ed25519-key', type: :ed25519, public_key: keypair.public_to_pem)
Fabricate(:keypair, account: actor, uri: 'https://server.example/users/alice#ed25519-key', type: :ed25519, public_key: pem)
end
it 'returns the actor' do
@@ -159,15 +147,9 @@ RSpec.describe ActivityPub::ObjectIntegrityProof do
end
before do
asn1 = OpenSSL::ASN1::Sequence(
[
OpenSSL::ASN1::Sequence([OpenSSL::ASN1::ObjectId('ED25519')]),
OpenSSL::ASN1::BitString(Multibase.decode_multicodec('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')[1]),
]
)
keypair = OpenSSL::PKey.read(asn1.to_der)
_, pem = Multibase.decode_key_to_pem('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')
Fabricate(:keypair, account: actor, uri: 'https://server.example/users/alice#ed25519-key', type: :ed25519, public_key: keypair.public_to_pem)
Fabricate(:keypair, account: actor, uri: 'https://server.example/users/alice#ed25519-key', type: :ed25519, public_key: pem)
end
it 'returns nil' do
@@ -180,14 +162,9 @@ RSpec.describe ActivityPub::ObjectIntegrityProof do
# https://www.w3.org/TR/vc-di-eddsa/#representation-eddsa-jcs-2022
let(:keypair) do
asn1 = OpenSSL::ASN1::Sequence(
[
OpenSSL::ASN1::Sequence([OpenSSL::ASN1::ObjectId('ED25519')]),
OpenSSL::ASN1::BitString(Multibase.decode_multicodec('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')[1]),
]
)
_, pem = Multibase.decode_key_to_pem('z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2')
OpenSSL::PKey.read(asn1.to_der)
OpenSSL::PKey.read(pem)
end
let(:secured_json) do