mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-13 15:58:13 +00:00
Compare commits
7 Commits
d4efd71326
...
2b8d002909
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2b8d002909 | ||
![]() |
94bceb8683 | ||
![]() |
88b0f3a172 | ||
![]() |
b69b5ba775 | ||
![]() |
2cadc7ab3b | ||
![]() |
467d61bce7 | ||
![]() |
d0b3137723 |
|
@ -71,6 +71,10 @@ class AccountsController < ApplicationController
|
|||
params[:username]
|
||||
end
|
||||
|
||||
def account_id_param
|
||||
params[:id]
|
||||
end
|
||||
|
||||
def skip_temporary_suspension_response?
|
||||
request.format == :json
|
||||
end
|
||||
|
|
|
@ -18,7 +18,11 @@ module AccountOwnedConcern
|
|||
end
|
||||
|
||||
def set_account
|
||||
@account = Account.find_local!(username_param)
|
||||
@account = username_param.present? ? Account.find_local!(username_param) : Account.local.find(account_id_param)
|
||||
end
|
||||
|
||||
def account_id_param
|
||||
params[:numeric_account_id]
|
||||
end
|
||||
|
||||
def username_param
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @ts-check
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {[code: string, name: string, localName: string]} InitialStateLanguage
|
||||
*/
|
||||
|
@ -64,6 +63,7 @@
|
|||
* @property {boolean=} critical_updates_pending
|
||||
* @property {InitialStateMeta} meta
|
||||
* @property {Role?} role
|
||||
* @property {string[]} features
|
||||
*/
|
||||
|
||||
const element = document.getElementById('initial-state');
|
||||
|
@ -140,4 +140,12 @@ export function getAccessToken() {
|
|||
return getMeta('access_token');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} feature
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isFeatureEnabled(feature) {
|
||||
return initialState?.features?.includes(feature) || false;
|
||||
}
|
||||
|
||||
export default initialState;
|
||||
|
|
|
@ -219,6 +219,9 @@
|
|||
"confirmations.delete_list.confirm": "Elimina",
|
||||
"confirmations.delete_list.message": "Segur que vols suprimir permanentment aquesta llista?",
|
||||
"confirmations.delete_list.title": "Eliminar la llista?",
|
||||
"confirmations.discard_draft.confirm": "Descarta i continua",
|
||||
"confirmations.discard_draft.edit.cancel": "Continua l'edició",
|
||||
"confirmations.discard_draft.post.cancel": "Reprendre l'esborrany",
|
||||
"confirmations.discard_edit_media.confirm": "Descarta",
|
||||
"confirmations.discard_edit_media.message": "Tens canvis no desats en la descripció del contingut o en la previsualització, els vols descartar?",
|
||||
"confirmations.follow_to_list.confirm": "Seguir i afegir a una llista",
|
||||
|
@ -792,6 +795,7 @@
|
|||
"report_notification.categories.violation": "Violació de norma",
|
||||
"report_notification.categories.violation_sentence": "violació de normes",
|
||||
"report_notification.open": "Obre l'informe",
|
||||
"search.clear": "Esborra la cerca",
|
||||
"search.no_recent_searches": "No hi ha cerques recents",
|
||||
"search.placeholder": "Cerca",
|
||||
"search.quick_action.account_search": "Perfils coincidint amb {x}",
|
||||
|
|
|
@ -572,7 +572,7 @@
|
|||
"navigation_bar.mutes": "Skjulte brugere",
|
||||
"navigation_bar.opened_in_classic_interface": "Indlæg, konti og visse andre sider åbnes som standard i den klassiske webgrænseflade.",
|
||||
"navigation_bar.preferences": "Præferencer",
|
||||
"navigation_bar.privacy_and_reach": "Fortrolighed og udbredelse",
|
||||
"navigation_bar.privacy_and_reach": "Fortrolighed og rækkevidde",
|
||||
"navigation_bar.search": "Søg",
|
||||
"navigation_bar.search_trends": "Søg/Trender",
|
||||
"navigation_panel.collapse_followed_tags": "Sammenfold menuen Fulgte hashtags",
|
||||
|
|
|
@ -39,11 +39,23 @@ class ActivityPub::TagManager
|
|||
|
||||
case target.object_type
|
||||
when :person
|
||||
target.instance_actor? ? instance_actor_url : account_url(target)
|
||||
if target.instance_actor?
|
||||
instance_actor_url
|
||||
elsif target.numeric_ap_id?
|
||||
ap_account_url(target.id)
|
||||
else
|
||||
account_url(target)
|
||||
end
|
||||
when :note, :comment, :activity
|
||||
return activity_account_status_url(target.account, target) if target.reblog?
|
||||
if target.account.numeric_ap_id?
|
||||
return activity_ap_status_url(target.account, target) if target.reblog?
|
||||
|
||||
account_status_url(target.account, target)
|
||||
ap_status_url(target)
|
||||
else
|
||||
return activity_account_status_url(target.account, target) if target.reblog?
|
||||
|
||||
account_status_url(target.account, target)
|
||||
end
|
||||
when :emoji
|
||||
emoji_url(target)
|
||||
when :flag
|
||||
|
@ -59,6 +71,10 @@ class ActivityPub::TagManager
|
|||
account_url(username: username)
|
||||
end
|
||||
|
||||
def uri_for_account_id(id)
|
||||
ap_account_url(id: id)
|
||||
end
|
||||
|
||||
def generate_uri_for(_target)
|
||||
URI.join(root_url, 'payloads', SecureRandom.uuid)
|
||||
end
|
||||
|
@ -66,55 +82,67 @@ class ActivityPub::TagManager
|
|||
def activity_uri_for(target)
|
||||
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
|
||||
|
||||
activity_account_status_url(target.account, target)
|
||||
target.account.numeric_ap_id? ? activity_ap_status_url(target) : activity_account_status_url(target.account, target)
|
||||
end
|
||||
|
||||
def replies_uri_for(target, page_params = nil)
|
||||
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
|
||||
|
||||
account_status_replies_url(target.account, target, page_params)
|
||||
target.account.numeric_ap_id? ? ap_status_replies_url(target, page_params) : account_status_replies_url(target.account, target, page_params)
|
||||
end
|
||||
|
||||
def likes_uri_for(target)
|
||||
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
|
||||
|
||||
account_status_likes_url(target.account, target)
|
||||
target.account.numeric_ap_id? ? ap_status_likes_url(target) : account_status_likes_url(target.account, target)
|
||||
end
|
||||
|
||||
def shares_uri_for(target)
|
||||
raise ArgumentError, 'target must be a local activity' unless %i(note comment activity).include?(target.object_type) && target.local?
|
||||
|
||||
account_status_shares_url(target.account, target)
|
||||
target.account.numeric_ap_id? ? ap_status_shares_url(target) : account_status_shares_url(target.account, target)
|
||||
end
|
||||
|
||||
def following_uri_for(target, ...)
|
||||
raise ArgumentError, 'target must be a local account' unless target.local?
|
||||
|
||||
account_following_index_url(target, ...)
|
||||
target.numeric_ap_id? ? ap_account_following_index_url(target.id, ...) : account_following_index_url(target, ...)
|
||||
end
|
||||
|
||||
def followers_uri_for(target, ...)
|
||||
return target.followers_url.presence unless target.local?
|
||||
|
||||
account_followers_url(target, ...)
|
||||
target.numeric_ap_id? ? ap_account_followers_url(target.id, ...) : account_followers_url(target, ...)
|
||||
end
|
||||
|
||||
def collection_uri_for(target, ...)
|
||||
raise NotImplementedError unless target.local?
|
||||
raise ArgumentError, 'target must be a local account' unless target.local?
|
||||
|
||||
account_collection_url(target, ...)
|
||||
target.numeric_ap_id? ? ap_account_collection_url(target.id, ...) : account_collection_url(target, ...)
|
||||
end
|
||||
|
||||
def inbox_uri_for(target)
|
||||
raise NotImplementedError unless target.local?
|
||||
raise ArgumentError, 'target must be a local account' unless target.local?
|
||||
|
||||
target.instance_actor? ? instance_actor_inbox_url : account_inbox_url(target)
|
||||
if target.instance_actor?
|
||||
instance_actor_inbox_url
|
||||
elsif target.numeric_ap_id?
|
||||
ap_account_inbox_url(target.id)
|
||||
else
|
||||
account_inbox_url(target)
|
||||
end
|
||||
end
|
||||
|
||||
def outbox_uri_for(target, ...)
|
||||
raise NotImplementedError unless target.local?
|
||||
raise ArgumentError, 'target must be a local account' unless target.local?
|
||||
|
||||
target.instance_actor? ? instance_actor_outbox_url(...) : account_outbox_url(target, ...)
|
||||
if target.instance_actor?
|
||||
instance_actor_outbox_url(...)
|
||||
elsif target.numeric_ap_id?
|
||||
ap_account_outbox_url(target.id, ...)
|
||||
else
|
||||
account_outbox_url(target, ...)
|
||||
end
|
||||
end
|
||||
|
||||
# Primary audience of a status
|
||||
|
@ -247,10 +275,9 @@ class ActivityPub::TagManager
|
|||
|
||||
path_params = Rails.application.routes.recognize_path(uri)
|
||||
|
||||
# TODO: handle numeric IDs
|
||||
case path_params[:controller]
|
||||
when 'accounts'
|
||||
[:username, path_params[:username]]
|
||||
path_params.key?(:username) ? [:username, path_params[:username]] : [:id, path_params[:id]]
|
||||
when 'instance_actors'
|
||||
[:id, -99]
|
||||
end
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
# requested_review_at :datetime
|
||||
# indexable :boolean default(FALSE), not null
|
||||
# attribution_domains :string default([]), is an Array
|
||||
# id_scheme :integer default("username_ap_id")
|
||||
#
|
||||
|
||||
class Account < ApplicationRecord
|
||||
|
@ -104,6 +105,7 @@ class Account < ApplicationRecord
|
|||
|
||||
enum :protocol, { ostatus: 0, activitypub: 1 }
|
||||
enum :suspension_origin, { local: 0, remote: 1 }, prefix: true
|
||||
enum :id_scheme, { username_ap_id: 0, numeric_ap_id: 1 }
|
||||
|
||||
validates :username, presence: true
|
||||
validates_with UniqueUsernameValidator, if: -> { will_save_change_to_username? }
|
||||
|
|
|
@ -215,8 +215,10 @@ module Account::Interactions
|
|||
def local_followers_hash
|
||||
Rails.cache.fetch("followers_hash:#{id}:local") do
|
||||
digest = "\x00" * 32
|
||||
followers.where(domain: nil).pluck_each(:username) do |username|
|
||||
Xorcist.xor!(digest, Digest::SHA256.digest(ActivityPub::TagManager.instance.uri_for_username(username)))
|
||||
# TODO
|
||||
followers.where(domain: nil).pluck_each('false as numeric_ap_id', :id, :username) do |numeric_ap_id, id, username|
|
||||
uri = numeric_ap_id ? ActivityPub::TagManager.instance.uri_for_account_id(id) : ActivityPub::TagManager.instance.uri_for_username(username)
|
||||
Xorcist.xor!(digest, Digest::SHA256.digest(uri))
|
||||
end
|
||||
digest.unpack1('H*')
|
||||
end
|
||||
|
|
|
@ -10,12 +10,6 @@ module DatabaseViewRecord
|
|||
concurrently: true,
|
||||
cascade: false
|
||||
)
|
||||
rescue ActiveRecord::StatementInvalid
|
||||
Scenic.database.refresh_materialized_view(
|
||||
table_name,
|
||||
concurrently: false,
|
||||
cascade: false
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
|
||||
attributes :meta, :compose, :accounts,
|
||||
:media_attachments, :settings,
|
||||
:languages
|
||||
:languages, :features
|
||||
|
||||
attribute :critical_updates_pending, if: -> { object&.role&.can?(:view_devops) && SoftwareUpdate.check_enabled? }
|
||||
|
||||
|
@ -85,6 +85,10 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
LanguagesHelper::SUPPORTED_LOCALES.map { |(key, value)| [key, value[0], value[1]] }
|
||||
end
|
||||
|
||||
def features
|
||||
Mastodon::Feature.enabled_features
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def default_meta_store
|
||||
|
|
|
@ -578,6 +578,11 @@ ca:
|
|||
all: Totes
|
||||
limited: Limitades
|
||||
title: Moderació
|
||||
moderation_notes:
|
||||
create: Afegeix una nota de moderació
|
||||
created_msg: S'ha creat la nota de moderació d'instància.
|
||||
destroyed_msg: S'ha esborrat la nota de moderació d'instància.
|
||||
title: Notes de moderació
|
||||
private_comment: Comentari privat
|
||||
public_comment: Comentari públic
|
||||
purge: Purga
|
||||
|
@ -1339,6 +1344,10 @@ ca:
|
|||
basic_information: Informació bàsica
|
||||
hint_html: "<strong>Personalitza el que la gent veu en el teu perfil públic i a prop dels teus tuts..</strong> És més probable que altres persones et segueixin i interaccionin amb tu quan tens emplenat el teu perfil i amb la teva imatge."
|
||||
other: Altres
|
||||
emoji_styles:
|
||||
auto: Automàtic
|
||||
native: Nadiu
|
||||
twemoji: Twemoji
|
||||
errors:
|
||||
'400': La sol·licitud que vas emetre no era vàlida o no era correcta.
|
||||
'403': No tens permís per a veure aquesta pàgina.
|
||||
|
|
|
@ -653,7 +653,7 @@ da:
|
|||
mark_as_sensitive_description_html: Medierne i det anmeldte indlæg markeres som sensitive, og en advarsel (strike) registreres mhp. eskalering ved evt. fremtidige overtrædelser fra samme konto.
|
||||
other_description_html: Se flere muligheder for at kontrollere kontoens adfærd og tilpasse kommunikationen til den anmeldte konto.
|
||||
resolve_description_html: Ingen foranstaltninger træffes mod den anmeldte konto, ingen advarsel (strike) registreres og anmeldelsen lukkes.
|
||||
silence_description_html: Kontoen vil kun være synlig for følgerene eller dem, som manuelt slå den op, hvilket markant begrænser dens udbredelse. Kan altid omgøres. Lukker alle indrapporteringer af kontoen.
|
||||
silence_description_html: Kontoen vil kun være synlig for dem, der allerede følger den eller manuelt slår den op, hvilket alvorligt begrænser dens rækkevidde. Kan altid omgøres. Lukker alle indrapporteringer af denne konto.
|
||||
suspend_description_html: Kontoen inkl. alt indhold utilgængeliggøres og interaktion umuliggøres, og den slettes på et tidspunkt. Kan omgøres inden for 30 dage. Lukker alle indrapporteringer af kontoen.
|
||||
actions_description_html: Afgør, hvilke foranstaltning, der skal træffes for at løse denne anmeldelse. Ved en straffende foranstaltning mod den anmeldte konto, fremsendes en e-mailnotifikation, undtagen når kategorien <strong>Spam</strong> er valgt.
|
||||
actions_description_remote_html: Fastslå en nødvendig handling mhp. at løse denne anmeldelse. Dette vil kun påvirke <strong>din</strong> servers kommunikation med, og indholdshåndtering for, fjernkontoen.
|
||||
|
@ -1266,8 +1266,8 @@ da:
|
|||
user_privacy_agreement_html: Jeg accepterer <a href="%{privacy_policy_path}" target="_blank">fortrolighedspolitikken</a>
|
||||
author_attribution:
|
||||
example_title: Eksempeltekst
|
||||
hint_html: Skriver du nyheder eller blogartikler uden for Mastodon? Styr, hvordan man bliver krediteret, når disse deles på Mastodon.
|
||||
instructions: 'Sørg for, at denne kode er i artikelens HTML:'
|
||||
hint_html: Skriver du nyheder eller blogartikler uden for Mastodon? Styr, hvordan du bliver krediteret, når de bliver delt på Mastodon.
|
||||
instructions: 'Sørg for, at denne kode er i din artikels HTML:'
|
||||
more_from_html: Flere fra %{name}
|
||||
s_blog: "%{name}s blog"
|
||||
then_instructions: Tilføj dernæst publikationsdomænenavnet i feltet nedenfor.
|
||||
|
@ -1718,11 +1718,11 @@ da:
|
|||
hint_html: "<strong>Tilpas hvordan din profil og dine indlæg kan findes.</strong> En række funktioner i Mastodon kan hjælpe dig med at nå ud til et bredere publikum, hvis du aktiverer dem. Tjek indstillingerne herunder for at sikre, at de passer til dit brugsscenarie."
|
||||
privacy: Privatliv
|
||||
privacy_hint_html: Styr, hvor meget der ønskes synliggjort til gavn for andre. Folk finder interessante profiler og apps ved at tjekke andres følgere ud, samt se hvilke apps de sender fra, men dine præferencer ønskes muligvis ikke synliggjort.
|
||||
reach: Udbredelse
|
||||
reach: Rækkevidde
|
||||
reach_hint_html: Indstil om du vil blive opdaget og fulgt af nye mennesker. Ønsker du, at dine indlæg skal vises på Udforsk-siden? Ønsker du, at andre skal se dig i deres følg-anbefalinger? Ønsker du at acceptere alle nye følgere automatisk, eller vil du have detaljeret kontrol over hver og en?
|
||||
search: Søg
|
||||
search: Søgning
|
||||
search_hint_html: Indstil hvordan du vil findes. Ønsker du, at folk skal finde dig gennem hvad du har skrevet offentligt? Vil du have folk udenfor Mastodon til at finde din profil, når de søger på nettet? Vær opmærksom på, at det ikke kan garanteres at dine offentlige indlæg er udelukket fra alle søgemaskiner.
|
||||
title: Fortrolighed og udbredelse
|
||||
title: Fortrolighed og rækkevidde
|
||||
privacy_policy:
|
||||
title: Privatlivspolitik
|
||||
reactions:
|
||||
|
@ -1923,7 +1923,7 @@ da:
|
|||
'7889238': 3 måneder
|
||||
min_age_label: Alderstærskel
|
||||
min_favs: Behold indlæg favoritmarkeret mindst
|
||||
min_favs_hint: Sletter ingen dine egne indlæg, som har modtaget minimum dette antal favoritmarkeringer. Lad stå tomt for at slette indlæg uanset antal favoritmarkeringer
|
||||
min_favs_hint: Sletter ingen af dine egne indlæg, som har modtaget minimum dette antal favoritmarkeringer. Lad stå tom for at slette indlæg uanset antal favoritmarkeringer
|
||||
min_reblogs: Behold indlæg fremhævet mindst
|
||||
min_reblogs_hint: Sletter ingen af dine egne indlæg, som er fremhævet flere end dette antal gange. Lad stå tom for at slette indlæg uanset antallet af fremhævelser
|
||||
stream_entries:
|
||||
|
@ -2095,7 +2095,7 @@ da:
|
|||
verification:
|
||||
extra_instructions_html: <strong>Tip:</strong> Linket på din hjemmeside kan være usynligt. Den vigtige del er <code>rel="me"</code> , som forhindrer impersonation på websteder med brugergenereret indhold. Du kan endda bruge et <code>link</code> tag i overskriften på siden i stedet for <code>a</code>, men HTML skal være tilgængelig uden at udføre JavaScript.
|
||||
here_is_how: Sådan gør du
|
||||
hint_html: "<strong>Bekræftelse af din identitet på Mastodon er for alle.</strong> Baseret på åbne webstandarder, nu og for evigt gratis. Alt du behøver er en personlig hjemmeside, som folk genkende dig ved. Når du linker til denne hjemmeside fra din profil, vi vil kontrollere, at hjemmesiden linker tilbage til din profil og vise en visuel indikator på det."
|
||||
hint_html: "<strong>Verificering af din identitet på Mastodon er for alle.</strong> Baseret på åbne webstandarder, nu og for altid gratis. Alt, hvad du behøver, er en personlig hjemmeside, som folk kender dig fra. Når du linker til denne hjemmeside fra din profil, kontrollerer vi, at hjemmesiden linker tilbage til din profil, og viser en visuel indikator på den."
|
||||
instructions_html: Kopier og indsæt koden nedenfor i HTML på din hjemmeside. Tilføj derefter adressen på din hjemmeside i et af de ekstra felter på din profil på fanen "Redigér profil" og gem ændringer.
|
||||
verification: Bekræftelse
|
||||
verified_links: Dine bekræftede links
|
||||
|
|
|
@ -1349,6 +1349,10 @@ hu:
|
|||
basic_information: Általános információk
|
||||
hint_html: "<strong>Tedd egyedivé, mi látnak mások a profilodon és a bejegyzéseid mellett.</strong> Mások nagyobb eséllyel követnek vissza és lépnek veled kapcsolatba, ha van kitöltött profilod és profilképed."
|
||||
other: Egyéb
|
||||
emoji_styles:
|
||||
auto: Automatikus
|
||||
native: Natív
|
||||
twemoji: Twemoji
|
||||
errors:
|
||||
'400': A küldött kérés érvénytelen vagy hibás volt.
|
||||
'403': Nincs jogosultságod az oldal megtekintéséhez.
|
||||
|
|
|
@ -61,6 +61,7 @@ ca:
|
|||
setting_display_media_default: Amaga el contingut gràfic marcat com a sensible
|
||||
setting_display_media_hide_all: Oculta sempre tot el contingut multimèdia
|
||||
setting_display_media_show_all: Mostra sempre el contingut gràfic
|
||||
setting_emoji_style: Com mostrar els emojis. "Automàtic" provarà de fer servir els emojis nadius, però revertirà a twemojis en els navegadors antics.
|
||||
setting_system_scrollbars_ui: S'aplica només als navegadors d'escriptori basats en Safari i Chrome
|
||||
setting_use_blurhash: Els degradats es basen en els colors de les imatges ocultes, però n'enfosqueixen els detalls
|
||||
setting_use_pending_items: Amaga les actualitzacions de la línia de temps després de fer un clic, en lloc de desplaçar-les automàticament
|
||||
|
@ -240,6 +241,7 @@ ca:
|
|||
setting_display_media_default: Per defecte
|
||||
setting_display_media_hide_all: Amaga-ho tot
|
||||
setting_display_media_show_all: Mostra-ho tot
|
||||
setting_emoji_style: Estil d'emojis
|
||||
setting_expand_spoilers: Desplega sempre els tuts marcats amb advertències de contingut
|
||||
setting_hide_network: Amaga la teva xarxa
|
||||
setting_missing_alt_text_modal: Mostra un diàleg de confirmació abans de publicar contingut sense text alternatiu
|
||||
|
|
|
@ -61,6 +61,7 @@ hu:
|
|||
setting_display_media_default: Kényes tartalomnak jelölt média elrejtése
|
||||
setting_display_media_hide_all: Média elrejtése mindig
|
||||
setting_display_media_show_all: Média megjelenítése mindig
|
||||
setting_emoji_style: Az emodzsik megjelenítési módja. Az „Automatikus” megpróbálja a natív emodzsikat használni, de az örökölt böngészők esetén a Twemojira vált vissza.
|
||||
setting_system_scrollbars_ui: Csak Chrome és Safari alapú asztali böngészőkre vonatkozik
|
||||
setting_use_blurhash: A kihomályosítás az eredeti képből történik, de minden részletet elrejt
|
||||
setting_use_pending_items: Idővonal frissítése csak kattintásra automatikus görgetés helyett
|
||||
|
@ -241,6 +242,7 @@ hu:
|
|||
setting_display_media_default: Alapértelmezés
|
||||
setting_display_media_hide_all: Mindent elrejt
|
||||
setting_display_media_show_all: Mindent mutat
|
||||
setting_emoji_style: Emodzsistílus
|
||||
setting_expand_spoilers: Tartalmi figyelmeztetéssel ellátott bejegyzések automatikus kinyitása
|
||||
setting_hide_network: Hálózatod elrejtése
|
||||
setting_missing_alt_text_modal: Megerősítési párbeszédablak megjelenítése a helyettesítő szöveg nélküli média közzététele előtt
|
||||
|
|
|
@ -95,7 +95,19 @@ Rails.application.routes.draw do
|
|||
|
||||
get '/authorize_follow', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" }
|
||||
|
||||
resources :accounts, path: 'users', only: [:show], param: :username do
|
||||
concern :account_resources do
|
||||
resources :followers, only: [:index], controller: :follower_accounts
|
||||
resources :following, only: [:index], controller: :following_accounts
|
||||
|
||||
scope module: :activitypub do
|
||||
resource :outbox, only: [:show]
|
||||
resource :inbox, only: [:create]
|
||||
resources :collections, only: [:show]
|
||||
resource :followers_synchronization, only: [:show]
|
||||
end
|
||||
end
|
||||
|
||||
resources :accounts, path: 'users', only: [:show], param: :username, concerns: :account_resources do
|
||||
resources :statuses, only: [:show] do
|
||||
member do
|
||||
get :activity
|
||||
|
@ -106,15 +118,19 @@ Rails.application.routes.draw do
|
|||
resources :likes, only: [:index], module: :activitypub
|
||||
resources :shares, only: [:index], module: :activitypub
|
||||
end
|
||||
end
|
||||
|
||||
resources :followers, only: [:index], controller: :follower_accounts
|
||||
resources :following, only: [:index], controller: :following_accounts
|
||||
scope path: 'ap', as: 'ap' do
|
||||
resources :accounts, path: 'users', only: [:show], param: :id, concerns: :account_resources do
|
||||
resources :statuses, module: :activitypub, only: [:show] do
|
||||
member do
|
||||
get :activity
|
||||
end
|
||||
|
||||
scope module: :activitypub do
|
||||
resource :outbox, only: [:show]
|
||||
resource :inbox, only: [:create]
|
||||
resources :collections, only: [:show]
|
||||
resource :followers_synchronization, only: [:show]
|
||||
resources :replies, only: [:index]
|
||||
resources :likes, only: [:index]
|
||||
resources :shares, only: [:index]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
7
db/migrate/20250707120259_add_id_scheme_to_accounts.rb
Normal file
7
db/migrate/20250707120259_add_id_scheme_to_accounts.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIdSchemeToAccounts < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :accounts, :id_scheme, :integer, default: 0
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_27_132728) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_07_07_120259) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_catalog.plpgsql"
|
||||
|
||||
|
@ -198,6 +198,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_27_132728) do
|
|||
t.datetime "requested_review_at", precision: nil
|
||||
t.boolean "indexable", default: false, null: false
|
||||
t.string "attribution_domains", default: [], array: true
|
||||
t.integer "id_scheme", default: 0
|
||||
t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
|
||||
t.index "lower((username)::text), COALESCE(lower((domain)::text), ''::text)", name: "index_accounts_on_username_and_domain_lower", unique: true
|
||||
t.index ["domain", "id"], name: "index_accounts_on_domain_and_id"
|
||||
|
|
|
@ -5,6 +5,14 @@ require 'rails_helper'
|
|||
RSpec.describe 'Accounts show response' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
context 'with numeric-based identifiers' do
|
||||
it 'returns http success' do
|
||||
get "/ap/users/#{account.id}"
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with an unapproved account' do
|
||||
before { account.user.update(approved: false) }
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe ActivityPub::SynchronizeFollowersService do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account', inbox_url: 'http://example.com/inbox') }
|
||||
let(:alice) { Fabricate(:account, username: 'alice') }
|
||||
let(:alice) { Fabricate(:account, username: 'alice', id_scheme: :numeric_ap_id) }
|
||||
let(:bob) { Fabricate(:account, username: 'bob') }
|
||||
let(:eve) { Fabricate(:account, username: 'eve') }
|
||||
let(:mallory) { Fabricate(:account, username: 'mallory') }
|
||||
|
|
Loading…
Reference in New Issue
Block a user