Compare commits

...

43 Commits

Author SHA1 Message Date
Eugen Rochko
5322654945 Merge branch 'master' into skylight 2017-04-19 19:24:31 +02:00
György Nádudvari
09dad88853 Fixed hungarian translation (#2158) 2017-04-19 19:21:44 +02:00
Tomohiro Suwa
7832425fdd Fix css for toot button when uploading images (#2161) 2017-04-19 19:21:23 +02:00
fsubal
abe16a7026 fix broken style when follower has long description (#2159) 2017-04-19 19:20:51 +02:00
Eugen Rochko
fcaa6ec4a6 Don't link robots.txt 2017-04-19 18:34:20 +02:00
Eugen Rochko
910ae09426 Merge branch 'master' into skylight 2017-04-19 17:48:44 +02:00
Eugen
baabbce672 Fix double-escaping of display names in <title> (#2155) 2017-04-19 17:46:24 +02:00
Eugen
1d47910d3b Fix possibility of unrightful webfinger redirect (#2147)
* Fix possibility of unrightful webfinger redirect

* Add more tests for FollowRemoteAccountService
2017-04-19 17:28:35 +02:00
Matt Jankowski
708bdd53f1 Remove unused view files in accounts/ (#2153) 2017-04-19 17:19:23 +02:00
Yamagishi Kazutoshi
2510119f19 Add meta tags for OGP to following & follow page (#2052)
* Add meta tags for OGP to following & follow page

* simplify render helper

* Follow up #2133

* og:type is only accounts/show

* revert accounts/{following,followers}
2017-04-19 17:17:32 +02:00
matsurai25
fe1ddc3b96 fix Japanese search result translation (#2149)
add 'result' mean, '件' only mean count unit.
2017-04-19 16:41:30 +02:00
Matteo Aquila
a3486e0543 Completed Italian translation (#2151)
* Added it.jsx

* Update index.jsx

* Update mastodon.jsx
2017-04-19 16:40:45 +02:00
matsurai25
30183c0a74 fix search text 'zero' (#2150) 2017-04-19 16:40:24 +02:00
Eugen Rochko
9a97beb3a5 Merge branch 'master' into skylight 2017-04-16 23:33:35 +02:00
Eugen Rochko
1ebcdf84b5 Merge branch 'master' into skylight 2017-04-13 22:28:33 +02:00
Eugen Rochko
791c0edfe8 Merge branch 'master' into skylight 2017-04-13 22:22:26 +02:00
Eugen Rochko
17c2ba7366 Merge branch 'master' into skylight 2017-04-13 21:55:13 +02:00
Eugen Rochko
f4ab6b9f2c Merge branch 'master' into skylight 2017-04-12 21:12:07 +02:00
Eugen Rochko
f63ccd8787 Change deploy 2017-04-12 18:25:34 +02:00
Eugen Rochko
7a1903cdf7 Merge branch 'master' into skylight 2017-04-12 11:28:37 +02:00
Eugen Rochko
4142036f2b Merge branch 'master' into skylight 2017-04-09 21:02:59 +02:00
Eugen Rochko
24656a9f8f Merge branch 'master' into skylight 2017-04-09 19:14:08 +02:00
Eugen Rochko
47910f57da Merge branch 'master' into skylight 2017-04-09 15:01:17 +02:00
Eugen Rochko
2a4499bb23 Merge branch 'master' into skylight 2017-04-08 22:27:03 +02:00
Eugen Rochko
e258d05848 Merge branch 'master' into skylight 2017-04-08 13:27:04 +02:00
Eugen Rochko
7c81c0f7cb Merge branch 'master' into skylight 2017-04-08 13:24:25 +02:00
Eugen Rochko
1ec81ccec0 Merge branch 'master' into skylight 2017-04-07 13:09:25 +02:00
Eugen Rochko
3fa8505769 Merge branch 'master' into skylight 2017-04-07 12:25:10 +02:00
Eugen Rochko
011bcbf21f Merge branch 'feature-ox-fix' into skylight 2017-04-07 11:09:29 +02:00
Eugen Rochko
6164662e1f Force UTF8 encoding on generated XML 2017-04-07 11:05:36 +02:00
Eugen Rochko
ed4d2d8a69 Merge branch 'master' into skylight 2017-04-07 05:59:59 +02:00
Eugen Rochko
453c15ab76 Merge branch 'master' into skylight 2017-04-07 00:06:58 +02:00
Eugen Rochko
2dc2003b99 Disable prepared_statements in production to allow use of pgbouncer 2017-04-06 20:50:13 +02:00
Eugen Rochko
4d1217d8f9 Merge branch 'master' into skylight 2017-04-06 20:50:05 +02:00
Eugen Rochko
0468256ab0 Merge branch 'master' into skylight 2017-04-06 02:27:36 +02:00
Eugen Rochko
634110d8bd Move ProcessingWorker/SalmonWorker into pull queue 2017-04-06 00:21:00 +02:00
Eugen Rochko
40d390e85d Merge branch 'master' into skylight 2017-04-05 21:44:22 +02:00
Eugen Rochko
31e086de0e Merge branch 'master' into skylight 2017-04-05 20:00:21 +02:00
Eugen Rochko
196e44b30b Merge branch 'master' into skylight 2017-04-05 14:29:51 +02:00
Eugen Rochko
945e5bf9cc Merge branch 'master' into skylight 2017-04-05 13:34:46 +02:00
Eugen Rochko
a24d55eed8 Add sidekiq-skylight 2017-04-05 02:36:06 +02:00
Eugen Rochko
7f7a67a7c1 Merge branch 'master' into skylight 2017-04-05 02:34:54 +02:00
Eugen Rochko
300bc70123 Add Skylight 2017-04-04 22:32:22 +02:00
34 changed files with 221 additions and 68 deletions

View File

@@ -62,6 +62,9 @@ gem 'react-rails'
gem 'browserify-rails'
gem 'autoprefixer-rails'
gem 'skylight'
gem 'sidekiq-skylight'
group :development, :test do
gem 'rspec-rails'
gem 'pry-rails'

View File

@@ -401,6 +401,9 @@ GEM
connection_pool (~> 2.2, >= 2.2.0)
rack-protection (>= 1.5.0)
redis (~> 3.2, >= 3.2.1)
sidekiq-skylight (0.2.0)
sidekiq (>= 3.3.0)
skylight (>= 0.5.2)
sidekiq-unique-jobs (5.0.0)
sidekiq (>= 4.0)
thor
@@ -414,6 +417,8 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
skylight (1.2.0)
activesupport (>= 3.0.0)
slop (3.6.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
@@ -532,10 +537,12 @@ DEPENDENCIES
ruby-oembed
sass-rails (~> 5.0)
sidekiq
sidekiq-skylight
sidekiq-unique-jobs
simple-navigation
simple_form
simplecov
skylight
sprockets-rails
statsd-instrument
twitter-text

View File

@@ -44,7 +44,10 @@ const Button = React.createClass({
cursor: 'pointer',
lineHeight: `${this.props.size}px`,
borderRadius: '4px',
textDecoration: 'none'
textDecoration: 'none',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
overflow: 'hidden'
};
return (

View File

@@ -48,6 +48,7 @@ import es from 'react-intl/locale-data/es';
import fi from 'react-intl/locale-data/fi';
import fr from 'react-intl/locale-data/fr';
import hu from 'react-intl/locale-data/hu';
import it from 'react-intl/locale-data/it';
import ja from 'react-intl/locale-data/ja';
import pt from 'react-intl/locale-data/pt';
import nl from 'react-intl/locale-data/nl';
@@ -78,6 +79,7 @@ addLocaleData([
...fi,
...fr,
...hu,
...it,
...ja,
...pt,
...pt_br,

View File

@@ -197,9 +197,9 @@ const ComposeForm = React.createClass({
<SpoilerButtonContainer />
</div>
<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', minWidth: 0 }}>
<div style={{ paddingTop: '10px', marginRight: '16px', lineHeight: '36px' }}><CharacterCounter max={500} text={text} /></div>
<div style={{ paddingTop: '10px' }}><Button text={publishText} onClick={this.handleSubmit} disabled={disabled || text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length > 500} /></div>
<div style={{ paddingTop: '10px', overflow: 'hidden' }}><Button text={publishText} onClick={this.handleSubmit} disabled={disabled || text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length > 500} block /></div>
</div>
</div>
</div>

View File

@@ -53,7 +53,7 @@ const SearchResults = React.createClass({
return (
<div className='search-results'>
<div className='search-results__header'>
<FormattedMessage id='search_results.total' defaultMessage='{count} {count, plural, one {result} other {results}}' values={{ count }} />
<FormattedMessage id='search_results.total' defaultMessage='{count, number} {count, plural, one {result} other {results}}' values={{ count }} />
</div>
{accounts}

View File

@@ -100,7 +100,7 @@ const en = {
"report.placeholder": "Additional comments",
"report.submit": "Submit",
"report.target": "Reporting",
"search_results.total": "{count} {count, plural, one {result} other {results}}",
"search_results.total": "{count, number} {count, plural, one {result} other {results}}",
"search.placeholder": "Search",
"search.status_by": "Status by {name}",
"status.delete": "Delete",

View File

@@ -81,7 +81,7 @@ const fr = {
"search.placeholder": "Rechercher",
"search.account": "Compte",
"search.hashtag": "Mot-clé",
"search_results.total": "{count} {count, plural, one {résultat} other {résultats}}",
"search_results.total": "{count, number} {count, plural, one {résultat} other {résultats}}",
"search.status_by": "Statuts de {name}",
"upload_button.label": "Joindre un média",
"upload_form.undo": "Annuler",

View File

@@ -90,7 +90,7 @@ const hr = {
"report.placeholder": "Dodatni komentari",
"report.submit": "Pošalji",
"report.target": "Prijavljivanje",
"search_results.total": "{count} {count, plural, one {result} other {results}}",
"search_results.total": "{count, number} {count, plural, one {result} other {results}}",
"search.placeholder": "Traži",
"search.status_by": "Status od {name}",
"status.delete": "Obriši",

View File

@@ -18,7 +18,7 @@ const hu = {
"account.block": "Blokkolás",
"account.follow": "Követés",
"account.posts": "Posts",
"account.follows": "Követők",
"account.follows": "Követve",
"account.followers": "Követők",
"account.follows_you": "Követnek téged",
"getting_started.heading": "Első lépések",

View File

@@ -3,6 +3,7 @@ import de from './de';
import es from './es';
import hr from './hr';
import hu from './hu';
import it from './it';
import fr from './fr';
import nl from './nl';
import no from './no';
@@ -23,6 +24,7 @@ const locales = {
es,
hr,
hu,
it,
fr,
nl,
no,

View File

@@ -0,0 +1,125 @@
const it = {
"account.block": "Blocca @{name}",
"account.disclaimer": "Questo utente si trova su un altro server. Questo numero potrebbe essere maggiore.",
"account.edit_profile": "Modifica profilo",
"account.follow": "Segui",
"account.followers": "Seguaci",
"account.follows_you": "Ti segue",
"account.follows": "Segue",
"account.mention": "Menziona @{name}",
"account.mute": "Silenzia @{name}",
"account.posts": "Posts",
"account.report": "Segnala @{name}",
"account.requested": "In attesa di approvazione",
"account.unblock": "Sblocca @{name}",
"account.unfollow": "Non seguire",
"account.unmute": "Non silenziare @{name}",
"boost_modal.combo": "Puoi premere {combo} per saltare questo passaggio la prossima volta",
"column_back_button.label": "Indietro",
"column.blocks": "Utenti bloccati",
"column.community": "Timeline locale",
"column.favourites": "Apprezzati",
"column.follow_requests": "Richieste di amicizia",
"column.home": "Home",
"column.mutes": "Utenti silenziati",
"column.notifications": "Notifiche",
"column.public": "Timeline federata",
"compose_form.placeholder": "A cosa stai pensando?",
"compose_form.privacy_disclaimer": "Il tuo status privato verrà condiviso con gli utenti menzionati su {domains}. Ti fidi di {domainsCount, plural, one {quel server} other {quei server}}? Le impostazioni sulla privacy valgono solo su server Mastodon. Se {domains} {domainsCount, plural, one {non è un server Mastodon} other {non sono server Mastodon}}, non ci saranno indicazioni sulla privacy del tuo status, e potrebbe essere condiviso o reso visibile a destinatari indesiderati.",
"compose_form.publish": "Toot",
"compose_form.sensitive": "Segnala file come sensibile",
"compose_form.spoiler_placeholder": "Content warning",
"compose_form.spoiler": "Nascondi testo con avvertimento",
"emoji_button.label": "Inserisci emoji",
"empty_column.community": "La timeline locale è vuota. Condividi qualcosa pubblicamente per dare inizio alla festa!",
"empty_column.hashtag": "Non c'è ancora nessun post con questo hashtag.",
"empty_column.home.public_timeline": "la timeline pubblica",
"empty_column.home": "Non stai ancora seguendo nessuno. Visita {public} o usa la ricerca per incontrare nuove persone.",
"empty_column.notifications": "Non hai ancora nessuna notifica. Interagisci con altri per iniziare conversazioni.",
"empty_column.public": "Qui non c'è nulla! Scrivi qualcosa pubblicamente, o aggiungi utenti da altri server per riempire questo spazio.",
"follow_request.authorize": "Autorizza",
"follow_request.reject": "Rifiuta",
"getting_started.apps": "Sono disponibili diverse app",
"getting_started.heading": "Come iniziare",
"getting_started.open_source_notice": "Mastodon è un software open source. Puoi contribuire o segnalare errori su GitHub all'indirizzo {github}. {apps}.",
"home.column_settings.advanced": "Avanzato",
"home.column_settings.basic": "Semplice",
"home.column_settings.filter_regex": "Filtra con espressioni regolari",
"home.column_settings.show_reblogs": "Mostra post condivisi",
"home.column_settings.show_replies": "Mostra risposte",
"home.settings": "Impostazioni colonna",
"lightbox.close": "Chiudi",
"loading_indicator.label": "Carico...",
"media_gallery.toggle_visible": "Imposta visibilità",
"missing_indicator.label": "Non trovato",
"navigation_bar.blocks": "Utenti bloccati",
"navigation_bar.community_timeline": "Timeline locale",
"navigation_bar.edit_profile": "Modifica profilo",
"navigation_bar.favourites": "Apprezzati",
"navigation_bar.follow_requests": "Richieste di amicizia",
"navigation_bar.info": "Informazioni estese",
"navigation_bar.logout": "Logout",
"navigation_bar.mutes": "Utenti silenziati",
"navigation_bar.preferences": "Impostazioni",
"navigation_bar.public_timeline": "Timeline federata",
"notification.favourite": "{name} ha apprezzato il tuo post",
"notification.follow": "{name} ha iniziato a seguirti",
"notification.mention": "{name} ti ha menzionato",
"notification.reblog": "{name} ha condiviso il tuo post",
"notifications.clear_confirmation": "Vuoi davvero cancellare tutte le notifiche?",
"notifications.clear": "Cancella notifiche",
"notifications.column_settings.alert": "Notifiche desktop",
"notifications.column_settings.favourite": "Apprezzati:",
"notifications.column_settings.follow": "Nuovi seguaci:",
"notifications.column_settings.mention": "Menzioni:",
"notifications.column_settings.reblog": "Post condivisi:",
"notifications.column_settings.show": "Mostra in colonna",
"notifications.column_settings.sound": "Riproduci suono",
"notifications.settings": "Impostazioni colonna",
"privacy.change": "Modifica privacy post",
"privacy.direct.long": "Invia solo a utenti menzionati",
"privacy.direct.short": "Diretto",
"privacy.private.long": "Invia solo ai seguaci",
"privacy.private.short": "Privato",
"privacy.public.long": "Invia alla timeline pubblica",
"privacy.public.short": "Pubblico",
"privacy.unlisted.long": "Non mostrare sulla timeline pubblica",
"privacy.unlisted.short": "Non elencato",
"reply_indicator.cancel": "Annulla",
"report.heading": "Nuova segnalazione",
"report.placeholder": "Commenti aggiuntivi",
"report.submit": "Invia",
"report.target": "Invio la segnalazione",
"search_results.total": "{count} {count, plural, one {risultato} other {risultati}}",
"search.placeholder": "Cerca",
"search.status_by": "Status per {name}",
"status.delete": "Elimina",
"status.favourite": "Apprezzato",
"status.load_more": "Mostra di più",
"status.media_hidden": "Allegato nascosto",
"status.mention": "Nomina @{name}",
"status.open": "Espandi questo post",
"status.reblog": "Condividi",
"status.reblogged_by": "{name} ha condiviso",
"status.reply": "Rispondi",
"status.report": "Segnala @{name}",
"status.sensitive_toggle": "Clicca per vedere",
"status.sensitive_warning": "Materiale sensibile",
"status.show_less": "Mostra meno",
"status.show_more": "Mostra di più",
"tabs_bar.compose": "Scrivi",
"tabs_bar.federated_timeline": "Federazione",
"tabs_bar.home": "Home",
"tabs_bar.local_timeline": "Locale",
"tabs_bar.notifications": "Notifiche",
"upload_area.title": "Trascina per caricare",
"upload_button.label": "Aggiungi file multimediale",
"upload_form.undo": "Annulla",
"upload_progress.label": "Sto caricando...",
"video_player.toggle_sound": "Attiva suono",
"video_player.toggle_visible": "Attiva visibilità",
"video_player.expand": "Espandi video",
"video_player.video_error": "Il video non può essere riprodotto",
};
export default it;

View File

@@ -110,7 +110,7 @@ const ja = {
"report.target": "問題のユーザー",
"search.placeholder": "検索",
"search.status_by": "{name}からの投稿",
"search_results.total": "{count} 件",
"search_results.total": "{count, number} 件の結果",
"status.delete": "削除",
"status.favourite": "お気に入り",
"status.load_more": "もっと見る",

View File

@@ -59,7 +59,7 @@ const nl = {
"search.placeholder": "Zoeken",
"search.account": "Account",
"search.hashtag": "Hashtag",
"search_results.total": "{count} {count, plural, one {resultaat} other {resultaten}}",
"search_results.total": "{count, number} {count, plural, one {resultaat} other {resultaten}}",
"upload_button.label": "Media toevoegen",
"upload_form.undo": "Ongedaan maken",
"notification.follow": "{name} volgt jou nu",

View File

@@ -87,7 +87,7 @@ const no = {
"report.placeholder": "Tilleggskommentarer",
"report.submit": "Send inn",
"report.target": "Rapporterer",
"search_results.total": "{count} {count, plural, one {resultat} other {resultater}}",
"search_results.total": "{count, number} {count, plural, one {resultat} other {resultater}}",
"search.placeholder": "Søk",
"search.status_by": "Status fra {name}",
"status.delete": "Slett",

View File

@@ -80,7 +80,7 @@ const oc = {
"search.placeholder": "Recercar",
"search.account": "Compte",
"search.hashtag": "Mot-clau",
"search_results.total": "{count} {count, plural, one {resultat} other {resultats}}",
"search_results.total": "{count, number} {count, plural, one {resultat} other {resultats}}",
"search.status_by": "Estatuts de {name}",
"upload_button.label": "Apondre un mèdia",
"upload_form.undo": "Anullar",

View File

@@ -90,7 +90,7 @@ const pt_br = {
"report.placeholder": "Comentários adicionais",
"report.submit": "Enviar",
"report.target": "Denunciar",
"search_results.total": "{count} {count, plural, one {resultado} other {resultados}}",
"search_results.total": "{count, number} {count, plural, one {resultado} other {resultados}}",
"search.placeholder": "Pesquisar",
"search.status_by": "Post de {name}",
"status.delete": "Eliminar",

View File

@@ -90,7 +90,7 @@ const pt = {
"report.placeholder": "Comentários adicionais",
"report.submit": "Enviar",
"report.target": "Denunciar",
"search_results.total": "{count} {count, plural, one {resultado} other {resultados}}",
"search_results.total": "{count, number} {count, plural, one {resultado} other {resultados}}",
"search.placeholder": "Pesquisar",
"search.status_by": "Post de {name}",
"status.delete": "Eliminar",

View File

@@ -92,7 +92,7 @@ const ru = {
"report.target": "Жалуемся на",
"search.placeholder": "Поиск",
"search.status_by": "Статус от {name}",
"search_results.total": "{count} {count, plural, one {result} other {results}}",
"search_results.total": "{count, number} {count, plural, one {result} other {results}}",
"status.delete": "Удалить",
"status.favourite": "Нравится",
"status.load_more": "Показать еще",

View File

@@ -119,7 +119,7 @@ const zh_cn = {
"report.placeholder": "额外消息",
"report.submit": "提交",
"report.target": "Reporting",
"search_results.total": "{count} 项结果",
"search_results.total": "{count, number} 项结果",
"search.account": "用户",
"search.hashtag": "标签",
"search.placeholder": "搜索",

View File

@@ -112,7 +112,7 @@ const zh_hk = {
"report.placeholder": "額外訊息",
"report.submit": "提交",
"report.target": "Reporting",
"search_results.total": "{count} 項結果",
"search_results.total": "{count, number} 項結果",
"search.account": "用戶",
"search.hashtag": "標籤",
"search.placeholder": "搜尋",

View File

@@ -237,13 +237,14 @@
}
.accounts-grid {
clear: both;
box-shadow: 0 0 15px rgba($color8, 0.2);
background: $color5;
border-radius: 0 0 4px 4px;
padding: 20px 10px;
padding-bottom: 10px;
overflow: hidden;
display: flex;
flex-wrap: wrap;
@media screen and (max-width: 700px) {
border-radius: 0;
@@ -253,11 +254,9 @@
.account-grid-card {
box-sizing: border-box;
width: 335px;
float: left;
border: 1px solid $color2;
border-radius: 4px;
color: $color1;
height: 160px;
margin-bottom: 10px;
&:nth-child(odd) {

View File

@@ -10,7 +10,7 @@ class FollowRemoteAccountService < BaseService
# important information from their feed
# @param [String] uri User URI in the form of username@domain
# @return [Account]
def call(uri)
def call(uri, redirected = nil)
username, domain = uri.split('@')
return Account.find_local(username) if TagManager.instance.local_domain?(domain)
@@ -24,8 +24,14 @@ class FollowRemoteAccountService < BaseService
raise Goldfinger::Error, 'Missing resource links' if data.link('http://schemas.google.com/g/2010#updates-from').nil? || data.link('salmon').nil? || data.link('http://webfinger.net/rel/profile-page').nil? || data.link('magic-public-key').nil?
# Disallow account hijacking
confirmed_username, confirmed_domain = data.subject.gsub(/\Aacct:/, '').split('@')
unless confirmed_username.casecmp(username).zero? && confirmed_domain.casecmp(domain).zero?
return call("#{confirmed_username}@#{confirmed_domain}", true) if redirected.nil?
raise Goldfinger::Error, 'Requested and returned acct URI do not match'
end
return Account.find_local(confirmed_username) if TagManager.instance.local_domain?(confirmed_domain)
confirmed_account = Account.find_remote(confirmed_username, confirmed_domain)

View File

@@ -0,0 +1,7 @@
%meta{ property: 'og:site_name', content: site_title }/
%meta{ property: 'og:title', content: [yield(:page_title).strip.presence, site_title].compact.join(' - ') }/
%meta{ property: 'og:description', content: account.note }/
%meta{ property: 'og:image', content: full_asset_url(account.avatar.url(:original)) }/
%meta{ property: 'og:image:width', content: '120' }/
%meta{ property: 'og:image:height', content: '120' }/
%meta{ property: 'twitter:card', content: 'summary' }/

View File

@@ -1,12 +0,0 @@
- content_for :page_title do
= t('accounts.people_who_follow', name: display_name(@account))
= render 'header', account: @account
.accounts-grid
- if @followers.empty?
= render 'nothing_here'
- else
= render partial: 'grid_card', collection: @followers, as: :account, cached: true
= paginate @followers

View File

@@ -1,12 +0,0 @@
- content_for :page_title do
= t('accounts.people_followed_by', name: display_name(@account))
= render 'header', account: @account
.accounts-grid
- if @following.empty?
= render 'nothing_here'
- else
= render partial: 'grid_card', collection: @following, as: :account, cached: true
= paginate @following

View File

@@ -5,14 +5,8 @@
%link{ rel: 'salmon', href: api_salmon_url(@account.id) }/
%link{ rel: 'alternate', type: 'application/atom+xml', href: account_url(@account, format: 'atom') }/
%meta{ property: 'og:site_name', content: site_title }/
%meta{ property: 'og:type', content: 'profile' }/
%meta{ property: 'og:title', content: "#{@account.username} on #{site_hostname}" }/
%meta{ property: 'og:description', content: @account.note }/
%meta{ property: 'og:image', content: full_asset_url(@account.avatar.url(:original)) }/
%meta{ property: 'og:image:width', content: '120' }/
%meta{ property: 'og:image:height', content: '120' }/
%meta{ property: 'twitter:card', content: 'summary' }/
= render 'og', account: @account
- if show_landing_strip?
= render partial: 'shared/landing_strip', locals: { account: @account }

View File

@@ -1,6 +1,9 @@
- content_for :page_title do
= t('accounts.people_who_follow', name: display_name(@account))
- content_for :header_tags do
= render 'accounts/og', account: @account
= render 'accounts/header', account: @account
= render 'accounts/follow_grid', accounts: @accounts

View File

@@ -1,6 +1,9 @@
- content_for :page_title do
= t('accounts.people_followed_by', name: display_name(@account))
- content_for :header_tags do
= render 'accounts/og', account: @account
= render 'accounts/header', account: @account
= render 'accounts/follow_grid', accounts: @accounts

View File

@@ -14,7 +14,7 @@
%title<
- if content_for?(:page_title)
= yield(:page_title).strip
= yield(:page_title)
= ' - '
= site_title

View File

@@ -3,7 +3,7 @@
class ProcessingWorker
include Sidekiq::Worker
sidekiq_options backtrace: true
sidekiq_options queue: 'pull', backtrace: true
def perform(account_id, body)
ProcessFeedService.new.call(body, Account.find(account_id))

View File

@@ -3,7 +3,7 @@
class SalmonWorker
include Sidekiq::Worker
sidekiq_options backtrace: true
sidekiq_options queue: 'pull', backtrace: true
def perform(account_id, body)
ProcessInteractionService.new.call(body, Account.find(account_id))

View File

@@ -1,14 +1,12 @@
# frozen_string_literal: true
lock '3.8.0'
set :repo_url, ENV.fetch('REPO', 'https://github.com/tootsuite/mastodon.git')
set :branch, ENV.fetch('BRANCH', 'master')
set :application, 'mastodon'
set :repo_url, 'https://github.com/tootsuite/mastodon.git'
set :branch, 'skylight'
set :rbenv_type, :user
set :rbenv_ruby, File.read('.ruby-version').strip
set :migration_role, :app
set :conditional_migrate, true
append :linked_files, '.env.production', 'public/robots.txt'
append :linked_dirs, 'vendor/bundle', 'node_modules', 'public/system'
append :linked_files, '.env.production'
append :linked_dirs, 'vendor/bundle', 'public/system'

View File

@@ -3,10 +3,35 @@ require 'rails_helper'
RSpec.describe FollowRemoteAccountService do
subject { FollowRemoteAccountService.new }
it 'returns nil if no such user can be resolved via webfinger'
it 'returns nil if the domain does not have webfinger'
it 'returns nil if remote user does not offer a hub URL'
it 'returns an already existing remote account'
it 'returns a new remote account'
it 'fills the remote account with profile information'
before do
stub_request(:get, "https://quitter.no/.well-known/host-meta").to_return(request_fixture('.host-meta.txt'))
stub_request(:get, "https://example.com/.well-known/host-meta").to_return(status: 404)
stub_request(:get, "https://quitter.no/.well-known/webfinger?resource=acct:gargron@quitter.no").to_return(request_fixture('webfinger.txt'))
stub_request(:get, "https://quitter.no/.well-known/webfinger?resource=acct:catsrgr8@quitter.no").to_return(status: 404)
stub_request(:get, "https://quitter.no/api/statuses/user_timeline/7477.atom").to_return(request_fixture('feed.txt'))
stub_request(:get, "https://quitter.no/avatar/7477-300-20160211190340.png").to_return(request_fixture('avatar.txt'))
end
it 'raises error if no such user can be resolved via webfinger' do
expect { subject.call('catsrgr8@quitter.no') }.to raise_error Goldfinger::Error
end
it 'raises error if the domain does not have webfinger' do
expect { subject.call('catsrgr8@example.com') }.to raise_error Goldfinger::Error
end
it 'returns an already existing remote account' do
old_account = Fabricate(:account, username: 'gargron', domain: 'quitter.no')
returned_account = subject.call('gargron@quitter.no')
expect(old_account.id).to eq returned_account.id
end
it 'returns a new remote account' do
account = subject.call('gargron@quitter.no')
expect(account.username).to eq 'gargron'
expect(account.domain).to eq 'quitter.no'
expect(account.remote_url).to eq 'https://quitter.no/api/statuses/user_timeline/7477.atom'
end
end