Skip to content

Commit

Permalink
Merge pull request #2853 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes up to 5dfdec6
  • Loading branch information
ClearlyClaire authored Sep 24, 2024
2 parents 6ac6d86 + 38744a4 commit 6551129
Show file tree
Hide file tree
Showing 127 changed files with 904 additions and 701 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ services:
hard: -1

libretranslate:
image: libretranslate/libretranslate:v1.6.0
image: libretranslate/libretranslate:v1.6.1
restart: unless-stopped
volumes:
- lt-data:/home/libretranslate/.local
Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ GEM
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.977.0)
aws-sdk-core (3.206.0)
aws-sdk-core (3.207.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.91.0)
aws-sdk-core (~> 3, >= 3.205.0)
aws-sdk-kms (1.92.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.163.0)
aws-sdk-core (~> 3, >= 3.205.0)
aws-sdk-s3 (1.164.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
Expand Down Expand Up @@ -289,7 +289,7 @@ GEM
raabro (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
google-protobuf (3.25.4)
google-protobuf (3.25.5)
googleapis-common-protos-types (1.15.0)
google-protobuf (>= 3.18, < 5.a)
haml (6.3.0)
Expand Down Expand Up @@ -406,7 +406,7 @@ GEM
llhttp-ffi (0.5.0)
ffi-compiler (~> 1.0)
rake (~> 13.0)
logger (1.6.0)
logger (1.6.1)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
Expand Down Expand Up @@ -781,7 +781,7 @@ GEM
scenic (1.8.0)
activerecord (>= 4.0.0)
railties (>= 4.0.0)
selenium-webdriver (4.24.0)
selenium-webdriver (4.25.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand Down
36 changes: 36 additions & 0 deletions app/controllers/activitypub/likes_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

class ActivityPub::LikesController < ActivityPub::BaseController
include Authorization

vary_by -> { 'Signature' if authorized_fetch_mode? }

before_action :require_account_signature!, if: :authorized_fetch_mode?
before_action :set_status

def index
expires_in 0, public: @status.distributable? && public_fetch_mode?
render json: likes_collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json'
end

private

def pundit_user
signed_request_account
end

def set_status
@status = @account.statuses.find(params[:status_id])
authorize @status, :show?
rescue Mastodon::NotPermittedError
not_found
end

def likes_collection_presenter
ActivityPub::CollectionPresenter.new(
id: account_status_likes_url(@account, @status),
type: :unordered,
size: @status.favourites_count
)
end
end
2 changes: 1 addition & 1 deletion app/controllers/activitypub/replies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ActivityPub::RepliesController < ActivityPub::BaseController
before_action :set_replies

def index
expires_in 0, public: public_fetch_mode?
expires_in 0, public: @status.distributable? && public_fetch_mode?
render json: replies_collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json', skip_activities: true
end

Expand Down
36 changes: 36 additions & 0 deletions app/controllers/activitypub/shares_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

class ActivityPub::SharesController < ActivityPub::BaseController
include Authorization

vary_by -> { 'Signature' if authorized_fetch_mode? }

before_action :require_account_signature!, if: :authorized_fetch_mode?
before_action :set_status

def index
expires_in 0, public: @status.distributable? && public_fetch_mode?
render json: shares_collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json'
end

private

def pundit_user
signed_request_account
end

def set_status
@status = @account.statuses.find(params[:status_id])
authorize @status, :show?
rescue Mastodon::NotPermittedError
not_found
end

def shares_collection_presenter
ActivityPub::CollectionPresenter.new(
id: account_status_shares_url(@account, @status),
type: :unordered,
size: @status.reblogs_count
)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
};

// Corresponds to (max-width: $no-gap-breakpoint - 1px) in SCSS
mediaQuery = 'matchMedia' in window && window.matchMedia('(max-width: 1206px)');
mediaQuery = 'matchMedia' in window && window.matchMedia('(max-width: 1174px)');

state = {
renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches),
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ a.account__display-name {
&__main {
box-sizing: border-box;
width: 100%;
flex: 0 0 auto;
flex: 0 1 auto;
display: flex;
flex-direction: column;

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/flavours/glitch/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ $media-modal-media-max-width: 100%;
// put margins on top and bottom of image to avoid the screen covered by image.
$media-modal-media-max-height: 80%;

$no-gap-breakpoint: 1207px;
$no-gap-breakpoint: 1175px;
$mobile-breakpoint: 630px;

$font-sans-serif: 'mastodon-font-sans-serif' !default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class ColumnsArea extends ImmutablePureComponent {
};

// Corresponds to (max-width: $no-gap-breakpoint - 1px) in SCSS
mediaQuery = 'matchMedia' in window && window.matchMedia('(max-width: 1206px)');
mediaQuery = 'matchMedia' in window && window.matchMedia('(max-width: 1174px)');

state = {
renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches),
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/an.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,6 @@
"keyboard_shortcuts.unfocus": "Retirar lo foco d'a caixa de redacción/busqueda",
"keyboard_shortcuts.up": "Ir enta alto en a lista",
"lightbox.close": "Zarrar",
"lightbox.compress": "Comprimir quadro de visualización d'imachen",
"lightbox.expand": "Expandir quadro de visualización d'imachen",
"lightbox.next": "Siguient",
"lightbox.previous": "Anterior",
"limited_account_hint.action": "Amostrar perfil de totz modos",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,6 @@
"keyboard_shortcuts.unfocus": "لإلغاء التركيز على حقل النص أو نافذة البحث",
"keyboard_shortcuts.up": "للانتقال إلى أعلى القائمة",
"lightbox.close": "إغلاق",
"lightbox.compress": "ضغط مربع عرض الصورة",
"lightbox.expand": "توسيع مربع عرض الصور",
"lightbox.next": "التالي",
"lightbox.previous": "العودة",
"limited_account_hint.action": "إظهار الملف التعريفي على أي حال",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@
"keyboard_shortcuts.unfocus": "Расфакусаваць тэкставую вобласць/пошукавы радок",
"keyboard_shortcuts.up": "Перамясціцца ўверх па спісе",
"lightbox.close": "Закрыць",
"lightbox.compress": "Сціснуць бачную вобласць выявы",
"lightbox.expand": "Павялічыць бачную вобласць выявы",
"lightbox.next": "Далей",
"lightbox.previous": "Назад",
"limited_account_hint.action": "Усе роўна паказваць профіль",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,6 @@
"keyboard_shortcuts.unfocus": "Разфокусиране на текстовото поле за съставяне/търсене",
"keyboard_shortcuts.up": "Преместване нагоре в списъка",
"lightbox.close": "Затваряне",
"lightbox.compress": "Свиване на полето за преглед на образи",
"lightbox.expand": "Разгъване на полето за преглед на образи",
"lightbox.next": "Напред",
"lightbox.previous": "Назад",
"limited_account_hint.action": "Показване на профила въпреки това",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@
"keyboard_shortcuts.unfocus": "Difokus an dachenn testenn/klask",
"keyboard_shortcuts.up": "Pignat er roll",
"lightbox.close": "Serriñ",
"lightbox.compress": "Bihanaat boest hewel ar skeudenn",
"lightbox.expand": "Ledanaat boest hewel ar skeudenn",
"lightbox.next": "Da-heul",
"lightbox.previous": "A-raok",
"limited_account_hint.action": "Diskouez an aelad memes tra",
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@
"keyboard_shortcuts.unfocus": "Descentra l'àrea de composició de text/cerca",
"keyboard_shortcuts.up": "Apuja a la llista",
"lightbox.close": "Tanca",
"lightbox.compress": "Comprimeix el quadre de visualització d’imatge",
"lightbox.expand": "Amplia el quadre de visualització d’imatge",
"lightbox.next": "Següent",
"lightbox.previous": "Anterior",
"lightbox.zoom_in": "Amplia fins a la mida real",
"lightbox.zoom_out": "Amplia fins a encabir",
"limited_account_hint.action": "Mostra el perfil de totes maneres",
"limited_account_hint.title": "Aquest perfil l'han amagat els moderadors de {domain}.",
"link_preview.author": "Per {name}",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/ckb.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@
"keyboard_shortcuts.unfocus": "بۆ دروستکردنی ناوچەی دەق/گەڕان",
"keyboard_shortcuts.up": "بۆ ئەوەی لە لیستەکەدا بڕۆیت",
"lightbox.close": "دابخە",
"lightbox.compress": "سندوقی نیشاندانی وێنە بپەستێنە",
"lightbox.expand": "فراوانکردنی سندوقی بینینی وێنە",
"lightbox.next": "داهاتوو",
"lightbox.previous": "پێشوو",
"limited_account_hint.action": "بەهەر حاڵ پڕۆفایلی پیشان بدە",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/co.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@
"keyboard_shortcuts.unfocus": "ùn fucalizà più l'area di testu",
"keyboard_shortcuts.up": "cullà indè a lista",
"lightbox.close": "Chjudà",
"lightbox.compress": "Cumprime a finestra d'affissera di i ritratti",
"lightbox.expand": "Ingrandà a finestra d'affissera di i ritratti",
"lightbox.next": "Siguente",
"lightbox.previous": "Pricidente",
"lists.account.add": "Aghjunghje à a lista",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@
"keyboard_shortcuts.unfocus": "Zrušit zaměření na nový příspěvek/hledání",
"keyboard_shortcuts.up": "Posunout v seznamu nahoru",
"lightbox.close": "Zavřít",
"lightbox.compress": "Sbalit pole zobrazení obrázku",
"lightbox.expand": "Rozbalit pole zobrazení obrázku",
"lightbox.next": "Další",
"lightbox.previous": "Předchozí",
"limited_account_hint.action": "Přesto profil zobrazit",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,6 @@
"keyboard_shortcuts.unfocus": "Dad-ffocysu ardal cyfansoddi testun/chwilio",
"keyboard_shortcuts.up": "Symud yn uwch yn y rhestr",
"lightbox.close": "Cau",
"lightbox.compress": "Cywasgu blwch gweld delwedd",
"lightbox.expand": "Ehangu blwch gweld delwedd",
"lightbox.next": "Nesaf",
"lightbox.previous": "Blaenorol",
"limited_account_hint.action": "Dangos y proffil beth bynnag",
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@
"keyboard_shortcuts.unfocus": "Fjern fokus fra tekstskrivningsområde/søgning",
"keyboard_shortcuts.up": "Flyt opad på listen",
"lightbox.close": "Luk",
"lightbox.compress": "Komprimér billedvisningsfelt",
"lightbox.expand": "Udvid billedvisningsfelt",
"lightbox.next": "Næste",
"lightbox.previous": "Forrige",
"lightbox.zoom_in": "Zoom til faktisk størrelse",
"lightbox.zoom_out": "Zoom for at tilpasse",
"limited_account_hint.action": "Vis profil alligevel",
"limited_account_hint.title": "Denne profil er blevet skjult af {domain}-moderatorerne.",
"link_preview.author": "Af {name}",
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/mastodon/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"compose_form.lock_disclaimer.lock": "geschützt",
"compose_form.placeholder": "Was gibt’s Neues?",
"compose_form.poll.duration": "Umfragedauer",
"compose_form.poll.multiple": "Mul­ti­ple-Choice",
"compose_form.poll.multiple": "Mehrfachauswahl",
"compose_form.poll.option_placeholder": "Option {number}",
"compose_form.poll.single": "Einfachauswahl",
"compose_form.poll.switch_to_multiple": "Mehrfachauswahl erlauben",
Expand Down Expand Up @@ -432,10 +432,10 @@
"keyboard_shortcuts.unfocus": "Eingabefeld/Suche nicht mehr fokussieren",
"keyboard_shortcuts.up": "Ansicht nach oben bewegen",
"lightbox.close": "Schließen",
"lightbox.compress": "Bildansicht verkleinern",
"lightbox.expand": "Bildansicht vergrößern",
"lightbox.next": "Vor",
"lightbox.previous": "Zurück",
"lightbox.zoom_in": "In Originalgröße anzeigen",
"lightbox.zoom_out": "In angepasster Größe anzeigen",
"limited_account_hint.action": "Profil trotzdem anzeigen",
"limited_account_hint.title": "Dieses Profil wurde von den Moderator*innen von {domain} ausgeblendet.",
"link_preview.author": "Von {name}",
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,6 @@
"keyboard_shortcuts.unfocus": "Αποεστίαση του πεδίου σύνθεσης/αναζήτησης",
"keyboard_shortcuts.up": "Μετακίνηση προς τα πάνω στη λίστα",
"lightbox.close": "Κλείσιμο",
"lightbox.compress": "Συμπίεση πλαισίου προβολής εικόνας",
"lightbox.expand": "Ανάπτυξη πλαισίου εμφάνισης εικόνας",
"lightbox.next": "Επόμενο",
"lightbox.previous": "Προηγούμενο",
"limited_account_hint.action": "Εμφάνιση προφίλ ούτως ή άλλως",
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@
"keyboard_shortcuts.unfocus": "to un-focus compose textarea/search",
"keyboard_shortcuts.up": "Move up in the list",
"lightbox.close": "Close",
"lightbox.compress": "Compress image view box",
"lightbox.expand": "Expand image view box",
"lightbox.next": "Next",
"lightbox.previous": "Previous",
"lightbox.zoom_in": "Zoom to actual size",
"lightbox.zoom_out": "Zoom to fit",
"limited_account_hint.action": "Show profile anyway",
"limited_account_hint.title": "This profile has been hidden by the moderators of {domain}.",
"link_preview.author": "By {name}",
Expand Down
Loading

0 comments on commit 6551129

Please sign in to comment.