From bcd499c3725d620bc9d4612e04add76cf7a4e395 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Thu, 2 Aug 2018 17:57:00 +0900 Subject: [PATCH 01/37] who to follow panel uses /api/v1/suggestions --- .../who_to_follow_panel/who_to_follow_panel.js | 16 ++++++---------- src/main.js | 13 +++++++++---- static/config.json | 5 ----- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index 51b9f4692..be9a9f315 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -7,12 +7,12 @@ function showWhoToFollow (panel, reply, aHost, aUser) { var user user = users[cn] var img - if (user.icon) { + if (user.avatar) { img = user.icon } else { img = '/images/avi.png' } - var name = user.to_id + var name = user.acct if (index === 0) { panel.img1 = img panel.name1 = name @@ -52,17 +52,13 @@ function showWhoToFollow (panel, reply, aHost, aUser) { } function getWhoToFollow (panel) { - var user = panel.$store.state.users.currentUser.screen_name - if (user) { + var credentials = panel.$store.state.users.currentUser.credentials + if (credentials) { panel.name1 = 'Loading...' panel.name2 = 'Loading...' panel.name3 = 'Loading...' - var host = window.location.hostname - var whoToFollowProvider = panel.$store.state.config.whoToFollowProvider - var url - url = whoToFollowProvider.replace(/{{host}}/g, encodeURIComponent(host)) - url = url.replace(/{{user}}/g, encodeURIComponent(user)) - window.fetch(url, {mode: 'cors'}).then(function (response) { + var url = '/api/v1/suggestions' + window.fetch(url, {headers: authHeaders(credentials)}).then(function (response) { if (response.ok) { return response.json() } else { diff --git a/src/main.js b/src/main.js index bacd7f6d6..3c2ac77d4 100644 --- a/src/main.js +++ b/src/main.js @@ -89,13 +89,10 @@ window.fetch('/api/statusnet/config.json') window.fetch('/static/config.json') .then((res) => res.json()) .then((data) => { - const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled} = data + const {theme, background, logo, showInstanceSpecificPanel, scopeOptionsEnabled} = data store.dispatch('setOption', { name: 'theme', value: theme }) store.dispatch('setOption', { name: 'background', value: background }) store.dispatch('setOption', { name: 'logo', value: logo }) - store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: showWhoToFollowPanel }) - store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider }) - store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink }) store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) if (data['chatDisabled']) { @@ -144,6 +141,14 @@ window.fetch('/static/config.json') }) }) +window.fetch('/nodeinfo/2.0.json') + .then((res) => res.json()) + .then((data) => { + const suggestions = data.metadata.suggestions + store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: suggestions.enabled }) + store.dispatch('setOption', { name: 'whoToFollowLink', value: suggestions.web }) + }) + window.fetch('/static/terms-of-service.html') .then((res) => res.text()) .then((html) => { diff --git a/static/config.json b/static/config.json index 4dacfebed..14eb5c92d 100644 --- a/static/config.json +++ b/static/config.json @@ -5,11 +5,6 @@ "redirectRootNoLogin": "/main/all", "redirectRootLogin": "/main/friends", "chatDisabled": false, - "showWhoToFollowPanel": false, - "whoToFollowProvider": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}", - "whoToFollowProviderDummy2": "https://followlink.osa-p.net/api/get_recommend.json?acct=@{{user}}@{{host}}", - "whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}", - "whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html", "showInstanceSpecificPanel": false, "scopeOptionsEnabled": false } From 5900bccff3f09be6bfbfa4a891c91ee043e3a9f0 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Thu, 2 Aug 2018 18:34:12 +0900 Subject: [PATCH 02/37] debug --- .../who_to_follow_panel.js | 19 +++++++------------ src/services/api/api.service.js | 10 +++++++++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index be9a9f315..5e85b95d9 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -1,4 +1,6 @@ -function showWhoToFollow (panel, reply, aHost, aUser) { +import apiService from '../../services/api/api.service.js' + +function showWhoToFollow (panel, reply) { var users = reply.ids var cn var index = 0 @@ -58,17 +60,10 @@ function getWhoToFollow (panel) { panel.name2 = 'Loading...' panel.name3 = 'Loading...' var url = '/api/v1/suggestions' - window.fetch(url, {headers: authHeaders(credentials)}).then(function (response) { - if (response.ok) { - return response.json() - } else { - panel.name1 = '' - panel.name2 = '' - panel.name3 = '' - } - }).then(function (reply) { - showWhoToFollow(panel, reply, host, user) - }) + apiService.suggestions ({credentials: credentials}) + .then ((reply) => { + showWhoToFollow(panel, reply) + }) } } diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index adf598b74..d07e43c6d 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -36,6 +36,7 @@ const CHANGE_PASSWORD_URL = '/api/pleroma/change_password' const FOLLOW_REQUESTS_URL = '/api/pleroma/friend_requests' const APPROVE_USER_URL = '/api/pleroma/friendships/approve' const DENY_USER_URL = '/api/pleroma/friendships/deny' +const SUGGESTIONS_URL = '/api/v1/suggestions' import { each, map } from 'lodash' import 'whatwg-fetch' @@ -448,6 +449,12 @@ const fetchMutes = ({credentials}) => { }).then((data) => data.json()) } +const suggestions = ({credentials}) => { + return fetch(SUGGESTIONS_URL, { + headers: authHeaders(credentials) + }).then((data) => data.json()) +} + const apiService = { verifyCredentials, fetchTimeline, @@ -481,7 +488,8 @@ const apiService = { changePassword, fetchFollowRequests, approveUser, - denyUser + denyUser, + suggestions } export default apiService From 19e310fc670d329896829d25d25d59a16b425ed1 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Thu, 2 Aug 2018 18:38:43 +0900 Subject: [PATCH 03/37] lint --- src/components/who_to_follow_panel/who_to_follow_panel.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index 5e85b95d9..5b7f6b946 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -59,9 +59,8 @@ function getWhoToFollow (panel) { panel.name1 = 'Loading...' panel.name2 = 'Loading...' panel.name3 = 'Loading...' - var url = '/api/v1/suggestions' - apiService.suggestions ({credentials: credentials}) - .then ((reply) => { + apiService.suggestions({credentials: credentials}) + .then((reply) => { showWhoToFollow(panel, reply) }) } From 5e47c59615a1ebe7c42a43eea2e93b814742e9e9 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Thu, 2 Aug 2018 19:16:48 +0900 Subject: [PATCH 04/37] debug --- src/components/who_to_follow_panel/who_to_follow_panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index 5b7f6b946..d7626dd41 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -1,7 +1,7 @@ import apiService from '../../services/api/api.service.js' function showWhoToFollow (panel, reply) { - var users = reply.ids + var users = reply var cn var index = 0 var random = Math.floor(Math.random() * 10) @@ -10,7 +10,7 @@ function showWhoToFollow (panel, reply) { user = users[cn] var img if (user.avatar) { - img = user.icon + img = user.avatar } else { img = '/images/avi.png' } From 3398303c9bf6fdf416797fddb843af74d80eb54f Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Thu, 9 Aug 2018 06:59:23 +0000 Subject: [PATCH 05/37] Update messages.js --- src/i18n/messages.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index e9d6e1768..7f6cb7b1e 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -763,30 +763,30 @@ const ja = { chat: 'ローカルチャット', timeline: 'タイムライン', mentions: 'メンション', - public_tl: '公開タイムライン', - twkn: '接続しているすべてのネットワーク' + public_tl: 'パブリックタイムライン', + twkn: 'つながっているすべてのネットワーク' }, user_card: { follows_you: 'フォローされました!', - following: 'フォロー中!', + following: 'フォローしています!', follow: 'フォロー', - blocked: 'ブロック済み!', + blocked: 'ブロックしています!', block: 'ブロック', - statuses: '投稿', + statuses: 'ステータス', mute: 'ミュート', - muted: 'ミュート済み', + muted: 'ミュートしています!', followers: 'フォロワー', followees: 'フォロー', per_day: '/日', remote_follow: 'リモートフォロー' }, timeline: { - show_new: '更新', - error_fetching: '更新の取得中にエラーが発生しました。', - up_to_date: '最新', - load_older: '古い投稿を読み込む', - conversation: '会話', - collapse: '折り畳む', + show_new: 'よみこみ', + error_fetching: 'よみこみがエラーになりました。', + up_to_date: 'さいしん', + load_older: 'ふるいステータス', + conversation: 'スレッド', + collapse: 'たたむ', repeated: 'リピート' }, settings: { From f8834ba1fbfaf5b0baf53568a199208f7b077eac Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Thu, 9 Aug 2018 07:20:35 +0000 Subject: [PATCH 06/37] Update messages.js --- src/i18n/messages.js | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 7f6cb7b1e..6624da9e6 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -790,51 +790,51 @@ const ja = { repeated: 'リピート' }, settings: { - user_settings: 'ユーザー設定', - name_bio: '名前とプロフィール', - name: '名前', + user_settings: 'ユーザーせってい', + name_bio: 'なまえとプロフィール', + name: 'なまえ', bio: 'プロフィール', avatar: 'アバター', - current_avatar: 'あなたの現在のアバター', - set_new_avatar: '新しいアバターを設定する', + current_avatar: 'いまのアバター', + set_new_avatar: 'あたらしいアバターをせっていする', profile_banner: 'プロフィールバナー', - current_profile_banner: '現在のプロフィールバナー', - set_new_profile_banner: '新しいプロフィールバナーを設定する', - profile_background: 'プロフィールの背景', - set_new_profile_background: '新しいプロフィールの背景を設定する', - settings: '設定', + current_profile_banner: 'いまのプロフィールバナー', + set_new_profile_banner: 'あたらしいプロフィールバナーを設定する', + profile_background: 'プロフィールのバックグラウンド', + set_new_profile_background: 'あたらしいプロフィールのバックグラウンドをせっていする', + settings: 'せってい', theme: 'テーマ', presets: 'プリセット', - theme_help: '16進数カラーコード (#aabbcc) を使用してカラーテーマをカスタマイズ出来ます。', - radii_help: 'インターフェースの縁の丸さを設定する。', - background: '背景', - foreground: '前景', - text: '文字', + theme_help: 'カラーテーマをカスタマイズできます。', + radii_help: 'インターフェースのまるさをせっていする。', + background: 'バックグラウンド', + foreground: 'フォアグラウンド', + text: 'もじ', links: 'リンク', - cBlue: '青 (返信, フォロー)', - cRed: '赤 (キャンセル)', - cOrange: 'オレンジ (お気に入り)', - cGreen: '緑 (リツイート)', + cBlue: 'あお (リプライ, フォロー)', + cRed: 'あか (キャンセル)', + cOrange: 'オレンジ (おきにいり)', + cGreen: 'みどり (リピート)', btnRadius: 'ボタン', panelRadius: 'パネル', avatarRadius: 'アバター', - avatarAltRadius: 'アバター (通知)', + avatarAltRadius: 'アバター (つうち)', tooltipRadius: 'ツールチップ/アラート', attachmentRadius: 'ファイル', filtering: 'フィルタリング', - filtering_explanation: 'これらの単語を含むすべてのものがミュートされます。1行に1つの単語を入力してください。', + filtering_explanation: 'これらのことばをふくむすべてのものがミュートされます。1行に1つのことばをかいてください。', attachments: 'ファイル', - hide_attachments_in_tl: 'タイムラインのファイルを隠す。', - hide_attachments_in_convo: '会話の中のファイルを隠す。', - nsfw_clickthrough: 'NSFWファイルの非表示を有効にする。', - stop_gifs: 'カーソルを重ねた時にGIFを再生する。', - autoload: '下にスクロールした時に自動で読み込むようにする。', - streaming: '上までスクロールした時に自動でストリーミングされるようにする。', - reply_link_preview: 'マウスカーソルを重ねた時に返信のプレビューを表示するようにする。', + hide_attachments_in_tl: 'タイムラインのファイルをかくす。', + hide_attachments_in_convo: 'スレッドのファイルをかくす。', + nsfw_clickthrough: 'NSFWなファイルをかくす。', + stop_gifs: 'カーソルをかさねたとき、GIFをうごかす。', + autoload: 'したにスクロールしたとき、じどうてきによみこむ。', + streaming: 'うえまでスクロールしたとき、じどうてきにストリーミングする。', + reply_link_preview: 'カーソルをかさねたとき、リプライのプレビューをみる。', follow_import: 'フォローインポート', import_followers_from_a_csv_file: 'CSVファイルからフォローをインポートする。', - follows_imported: 'フォローがインポートされました!処理に少し時間がかかるかもしれません。', - follow_import_error: 'フォロワーのインポート中にエラーが発生しました。' + follows_imported: 'フォローがインポートされました! すこしじかんがかかるかもしれません。', + follow_import_error: 'フォロワーのインポートがエラーになりました。' }, notifications: { notifications: '通知', From 6cc1083287ee06baedb859e61e7965fc06c93f53 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Thu, 9 Aug 2018 07:30:22 +0000 Subject: [PATCH 07/37] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=81=AF=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/messages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 6624da9e6..cf963c0ef 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -834,7 +834,7 @@ const ja = { follow_import: 'フォローインポート', import_followers_from_a_csv_file: 'CSVファイルからフォローをインポートする。', follows_imported: 'フォローがインポートされました! すこしじかんがかかるかもしれません。', - follow_import_error: 'フォロワーのインポートがエラーになりました。' + follow_import_error: 'フォローのインポートがエラーになりました。' }, notifications: { notifications: '通知', From 23cfec4332933c9e37666a54ec475d870fa34ff4 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Fri, 10 Aug 2018 07:04:25 +0000 Subject: [PATCH 08/37] Update messages.js --- src/i18n/messages.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index cf963c0ef..07f4354d6 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -837,38 +837,38 @@ const ja = { follow_import_error: 'フォローのインポートがエラーになりました。' }, notifications: { - notifications: '通知', - read: '読んだ!', + notifications: 'つうち', + read: 'よんだ!', followed_you: 'フォローされました', - favorited_you: 'あなたの投稿がお気に入りされました', - repeated_you: 'あなたの投稿がリピートされました' + favorited_you: 'あなたのステータスがおきにいりされました', + repeated_you: 'あなたのステータスがリピートされました' }, login: { login: 'ログイン', - username: 'ユーザー名', - placeholder: '例えば lain', + username: 'ユーザーめい', + placeholder: 'れい: lain', password: 'パスワード', - register: '登録', + register: 'はじめる', logout: 'ログアウト' }, registration: { - registration: '登録', - fullname: '表示名', + registration: 'はじめる', + fullname: 'スクリーンネーム', email: 'Eメール', bio: 'プロフィール', - password_confirm: 'パスワードの確認' + password_confirm: 'パスワードのかくにん' }, post_status: { - posting: '投稿', - default: 'ちょうどL.A.に着陸しました。' + posting: 'とうこう', + default: 'はねだくうこうに、つきました。' }, finder: { - find_user: 'ユーザー検索', - error_fetching_user: 'ユーザー検索でエラーが発生しました' + find_user: 'ユーザーをさがす', + error_fetching_user: 'ユーザーけんさくがエラーになりました。' }, general: { - submit: '送信', - apply: '適用' + submit: 'そうしん', + apply: 'てきよう' }, user_profile: { timeline_title: 'ユーザータイムライン' From b7d1bb39e0c5929941a2e32243da1ddf6f2ce5a0 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 11 Aug 2018 14:35:04 +0900 Subject: [PATCH 09/37] update --- src/i18n/messages.js | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 07f4354d6..38cf5ef07 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -764,7 +764,8 @@ const ja = { timeline: 'タイムライン', mentions: 'メンション', public_tl: 'パブリックタイムライン', - twkn: 'つながっているすべてのネットワーク' + twkn: 'つながっているすべてのネットワーク', + friend_requests: 'Follow Requests' }, user_card: { follows_you: 'フォローされました!', @@ -778,7 +779,9 @@ const ja = { followers: 'フォロワー', followees: 'フォロー', per_day: '/日', - remote_follow: 'リモートフォロー' + remote_follow: 'リモートフォロー', + approve: 'Approve', + deny: 'Deny' }, timeline: { show_new: 'よみこみ', @@ -816,6 +819,7 @@ const ja = { cOrange: 'オレンジ (おきにいり)', cGreen: 'みどり (リピート)', btnRadius: 'ボタン', + inputRadius: 'Input fields', panelRadius: 'パネル', avatarRadius: 'アバター', avatarAltRadius: 'アバター (つうち)', @@ -834,7 +838,21 @@ const ja = { follow_import: 'フォローインポート', import_followers_from_a_csv_file: 'CSVファイルからフォローをインポートする。', follows_imported: 'フォローがインポートされました! すこしじかんがかかるかもしれません。', - follow_import_error: 'フォローのインポートがエラーになりました。' + follow_import_error: 'フォローのインポートがエラーになりました。', + delete_account: 'アカウントをけす', + delete_account_description: 'あなたのアカウントとメッセージが、きえます。', + delete_account_instructions: 'ほんとうにアカウントをけしてもいいなら、パスワードをかいてください。', + delete_account_error: 'アカウントをけすことが、できなかったかもしれません。インスタンスのかんりしゃに、れんらくしてください。', + follow_export: 'フォローのエクスポート', + follow_export_processing: 'おまちください。まもなくファイルをダウンロードできます。', + follow_export_button: 'エクスポート', + change_password: 'パスワードをかえる', + current_password: 'いまのパスワード', + new_password: 'あたらしいパスワード', + confirm_new_password: 'あたらしいパスワードのかくにん', + changed_password: 'パスワードが、かわりました!', + change_password_error: 'パスワードをかえることが、できなかったかもしれません。', + lock_account_description: 'あなたがみとめたひとだけ、あなたのアカウントをフォローできます。' }, notifications: { notifications: 'つうち', @@ -860,7 +878,17 @@ const ja = { }, post_status: { posting: 'とうこう', - default: 'はねだくうこうに、つきました。' + content_warning: 'せつめい (かかなくてもよい)', + default: 'はねだくうこうに、つきました。', + account_not_locked_warning: 'あなたのアカウントは {0} ではありません。あなたをフォローすれば、だれでも、フォロワーげんていのステータスをよむことができます。', + account_not_locked_warning_link: 'ロックされたアカウント', + direct_warning: 'このステータスは、メンションされたユーザーだけが、よむことができます。', + scope: { + public: 'パブリック - パブリックタイムラインにとどきます。', + unlisted: 'アンリステッド - パブリックタイムラインにとどきません。', + private: 'フォロワーげんてい - フォロワーのみにとどきます。', + direct: 'ダイレクト - メンションされたユーザーのみにとどきます。' + } }, finder: { find_user: 'ユーザーをさがす', From e2dae877728296373389954858fa86d61aa25f91 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 11 Aug 2018 14:50:40 +0900 Subject: [PATCH 10/37] update --- .../who_to_follow_panel/who_to_follow_panel.vue | 4 ++-- src/i18n/messages.js | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index 5af6d0d5e..d111d4be3 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -3,7 +3,7 @@
- Who to follow + $t('who_to_follow.who_to_follow')
@@ -11,7 +11,7 @@ {{ name1 }}
{{ name2 }}
{{ name3 }}
- More + $t('who_to_follow.more')

diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 38cf5ef07..abaea258e 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -380,6 +380,10 @@ const en = { }, user_profile: { timeline_title: 'User Timeline' + }, + who_to_follow: { + who_to_follow: 'Who to follow', + more: 'More' } } @@ -900,6 +904,10 @@ const ja = { }, user_profile: { timeline_title: 'ユーザータイムライン' + }, + who_to_follow: { + who_to_follow: 'おすすめユーザー', + more: 'くわしく' } } From d1b3d7e90fd76592b17691ebf391052f5e1f26a2 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 11 Aug 2018 14:54:30 +0900 Subject: [PATCH 11/37] debug --- src/components/who_to_follow_panel/who_to_follow_panel.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index d111d4be3..8b3abe700 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -3,7 +3,7 @@
- $t('who_to_follow.who_to_follow') + {{$t('who_to_follow.who_to_follow')}}
@@ -11,7 +11,7 @@ {{ name1 }}
{{ name2 }}
{{ name3 }}
- $t('who_to_follow.more') + {{$t('who_to_follow.more')}}

From 95e6bccec5a3bb89ca6b1511f12eb0caf5a241a4 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 20 Aug 2018 18:06:29 +0000 Subject: [PATCH 12/37] Revert "Unify button styles and use min-width" This reverts commit 8f7919388391742671ef0398e017383d7f0b2bc5. --- src/App.scss | 2 -- src/components/login_form/login_form.vue | 5 +++++ src/components/post_status_form/post_status_form.vue | 4 ++++ src/components/settings/settings.vue | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/App.scss b/src/App.scss index ae6561a94..3b8b3224b 100644 --- a/src/App.scss +++ b/src/App.scss @@ -63,8 +63,6 @@ button{ box-shadow: 0px 0px 2px black; font-size: 14px; font-family: sans-serif; - min-width: 10em; - min-height: 2em; &:hover { box-shadow: 0px 0px 4px rgba(255, 255, 255, 0.3); diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue index d2bdffcb4..b7fed48af 100644 --- a/src/components/login_form/login_form.vue +++ b/src/components/login_form/login_form.vue @@ -34,6 +34,11 @@ @import '../../_variables.scss'; .login-form { + .btn { + min-height: 28px; + width: 10em; + } + .error { text-align: center; } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 1e1c6f1da..2b84758ba 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -107,6 +107,10 @@ padding: 0.5em; height: 32px; + button { + width: 10em; + } + p { margin: 0.35em; padding: 0.35em; diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 170f57738..415317f03 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -117,6 +117,8 @@ .btn { margin-top: 1em; + min-height: 28px; + width: 10em; } } .setting-list { From 2596f228140c693aaecd192b0d10254250fc4bcd Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 21 Aug 2018 19:16:03 +0100 Subject: [PATCH 13/37] Centre-align profile bios. --- src/components/user_card_content/user_card_content.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 71222d15c..593580405 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -105,8 +105,8 @@ {{user.followers_count}} -

-

{{ user.description }}

+

+

{{ user.description }}

@@ -130,7 +130,11 @@ .profile-panel-body { word-wrap: break-word; background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80%); - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80%) + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80%); + + .profile-bio { + text-align: center; + } } .user-info { From bebd9c5ec8224c4be5b94e3cccf763f1a3489910 Mon Sep 17 00:00:00 2001 From: tsukada-ecsec Date: Wed, 22 Aug 2018 11:35:56 +0900 Subject: [PATCH 14/37] revert --- static/config.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/config.json b/static/config.json index 14eb5c92d..62b85aae5 100644 --- a/static/config.json +++ b/static/config.json @@ -5,6 +5,12 @@ "redirectRootNoLogin": "/main/all", "redirectRootLogin": "/main/friends", "chatDisabled": false, + "showWhoToFollowPanel": false, + "whoToFollowProvider": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}", + "whoToFollowProviderDummy2": "https://followlink.osa-p.net/api/get_recommend.json?acct=@{{user}}@{{host}}", + "whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}", + "whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html", "showInstanceSpecificPanel": false, - "scopeOptionsEnabled": false + "scopeOptionsEnabled": false, + "collapseMessageWithSubject": false } From 41256045f2f11bdcb9874f08288a66a9c47aa28a Mon Sep 17 00:00:00 2001 From: tsukada-ecsec Date: Wed, 22 Aug 2018 11:38:04 +0900 Subject: [PATCH 15/37] revert main.js --- src/main.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main.js b/src/main.js index 3c2ac77d4..06f8a6ec5 100644 --- a/src/main.js +++ b/src/main.js @@ -45,6 +45,7 @@ Vue.use(VueChatScroll) const persistedStateOptions = { paths: [ + 'config.collapseMessageWithSubject', 'config.hideAttachments', 'config.hideAttachmentsInConv', 'config.hideNsfw', @@ -53,6 +54,11 @@ const persistedStateOptions = { 'config.streaming', 'config.muteWords', 'config.customTheme', + 'config.highlight', + 'config.loopVideo', + 'config.loopVideoSilentOnly', + 'config.pauseOnUnfocused', + 'config.stopGifs', 'users.lastLoginName' ] } @@ -79,22 +85,27 @@ const i18n = new VueI18n({ window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { - const {name, closed: registrationClosed, textlimit} = data.site + const {name, closed: registrationClosed, textlimit, server} = data.site store.dispatch('setOption', { name: 'name', value: name }) store.dispatch('setOption', { name: 'registrationOpen', value: (registrationClosed === '0') }) store.dispatch('setOption', { name: 'textlimit', value: parseInt(textlimit) }) + store.dispatch('setOption', { name: 'server', value: server }) }) window.fetch('/static/config.json') .then((res) => res.json()) .then((data) => { - const {theme, background, logo, showInstanceSpecificPanel, scopeOptionsEnabled} = data + const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled, collapseMessageWithSubject} = data store.dispatch('setOption', { name: 'theme', value: theme }) store.dispatch('setOption', { name: 'background', value: background }) store.dispatch('setOption', { name: 'logo', value: logo }) + store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: showWhoToFollowPanel }) + store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider }) + store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink }) store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) + store.dispatch('setOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject }) if (data['chatDisabled']) { store.dispatch('disableChat') } @@ -116,6 +127,7 @@ window.fetch('/static/config.json') { name: 'mentions', path: '/:username/mentions', component: Mentions }, { name: 'settings', path: '/settings', component: Settings }, { name: 'registration', path: '/registration', component: Registration }, + { name: 'registration', path: '/registration/:token', component: Registration }, { name: 'friend-requests', path: '/friend-requests', component: FollowRequests }, { name: 'user-settings', path: '/user-settings', component: UserSettings } ] @@ -141,14 +153,6 @@ window.fetch('/static/config.json') }) }) -window.fetch('/nodeinfo/2.0.json') - .then((res) => res.json()) - .then((data) => { - const suggestions = data.metadata.suggestions - store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: suggestions.enabled }) - store.dispatch('setOption', { name: 'whoToFollowLink', value: suggestions.web }) - }) - window.fetch('/static/terms-of-service.html') .then((res) => res.text()) .then((html) => { From 54166c3ad3bd3c9377d7788b84733c19d16732ad Mon Sep 17 00:00:00 2001 From: tsukada-ecsec Date: Wed, 22 Aug 2018 11:47:36 +0900 Subject: [PATCH 16/37] update settings --- src/App.js | 2 +- src/App.vue | 2 +- src/components/who_to_follow_panel/who_to_follow_panel.js | 4 ++-- src/main.js | 8 ++++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index a052e058e..39c97a80d 100644 --- a/src/App.js +++ b/src/App.js @@ -29,7 +29,7 @@ export default { style () { return { 'background-image': `url(${this.background})` } }, sitename () { return this.$store.state.config.name }, chat () { return this.$store.state.chat.channel.state === 'joined' }, - showWhoToFollowPanel () { return this.$store.state.config.showWhoToFollowPanel }, + suggestionsEnabled () { return this.$store.state.config.suggestionsEnabled }, showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel } }, methods: { diff --git a/src/App.vue b/src/App.vue index 923d411b1..71e902891 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,7 +24,7 @@ - + diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index d7626dd41..70b35980b 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -85,9 +85,9 @@ const WhoToFollowPanel = { moreUrl: function () { var host = window.location.hostname var user = this.user - var whoToFollowLink = this.$store.state.config.whoToFollowLink + var suggestionsWeb = this.$store.state.config.suggestionsWeb var url - url = whoToFollowLink.replace(/{{host}}/g, encodeURIComponent(host)) + url = suggestionsWeb.replace(/{{host}}/g, encodeURIComponent(host)) url = url.replace(/{{user}}/g, encodeURIComponent(user)) return url }, diff --git a/src/main.js b/src/main.js index 06f8a6ec5..4124214da 100644 --- a/src/main.js +++ b/src/main.js @@ -192,3 +192,11 @@ window.fetch('/instance/panel.html') store.dispatch('setOption', { name: 'instanceSpecificPanelContent', value: html }) }) +window.fetch('/nodeinfo/2.0.json') + .then((res) => res.json()) + .then((data) => { + const suggestions = data.metadata.suggestions + store.dispatch('setOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) + store.dispatch('setOption', { name: 'suggestionsWeb', value: suggestions.web }) + }) + From 0647c1bb720144b3d9e3d7943129d0d67d176ab0 Mon Sep 17 00:00:00 2001 From: tsukada-ecsec Date: Wed, 22 Aug 2018 15:15:15 +0900 Subject: [PATCH 17/37] debug --- src/components/who_to_follow_panel/who_to_follow_panel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index 70b35980b..6766e561b 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -91,20 +91,20 @@ const WhoToFollowPanel = { url = url.replace(/{{user}}/g, encodeURIComponent(user)) return url }, - showWhoToFollowPanel () { - return this.$store.state.config.showWhoToFollowPanel + suggestionsEnabled () { + return this.$store.state.config.suggestionsEnabled } }, watch: { user: function (user, oldUser) { - if (this.showWhoToFollowPanel) { + if (this.suggestionsEnabled) { getWhoToFollow(this) } } }, mounted: function () { - if (this.showWhoToFollowPanel) { + if (this.suggestionsEnabled) { getWhoToFollow(this) } } From 13acdc4a00f7c4e8487de0c95fe69ff110f13e6e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 22 Aug 2018 15:51:03 +0300 Subject: [PATCH 18/37] fixed error not displaying for 500 error. --- .../notifications_fetcher/notifications_fetcher.service.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index 74a4bcda1..1480cded4 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -25,6 +25,7 @@ const fetchAndUpdate = ({store, credentials, older = false}) => { .then((notifications) => { update({store, notifications, older}) }, () => store.dispatch('setNotificationsError', { value: true })) + .catch(() => store.dispatch('setNotificationsError', { value: true })) } const startFetching = ({credentials, store}) => { From dfc5f170c6977039bd8704723fcfbb86dd7bf702 Mon Sep 17 00:00:00 2001 From: tsukada-ecsec Date: Fri, 24 Aug 2018 18:46:14 +0900 Subject: [PATCH 19/37] update --- src/main.js | 118 +++++++++++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 51 deletions(-) diff --git a/src/main.js b/src/main.js index 06f8a6ec5..f8144facf 100644 --- a/src/main.js +++ b/src/main.js @@ -93,63 +93,79 @@ window.fetch('/api/statusnet/config.json') store.dispatch('setOption', { name: 'server', value: server }) }) -window.fetch('/static/config.json') +window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { - const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled, collapseMessageWithSubject} = data - store.dispatch('setOption', { name: 'theme', value: theme }) - store.dispatch('setOption', { name: 'background', value: background }) - store.dispatch('setOption', { name: 'logo', value: logo }) - store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: showWhoToFollowPanel }) - store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider }) - store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink }) - store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) - store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) - store.dispatch('setOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject }) - if (data['chatDisabled']) { - store.dispatch('disableChat') - } + var apiStatusnetConfigSitePleromafe = data.site.pleromafe + window.fetch('/static/sonfig.json') + .then((data) => { + var staticConfig = data - const routes = [ - { name: 'root', - path: '/', - redirect: to => { - var redirectRootLogin = data['redirectRootLogin'] - var redirectRootNoLogin = data['redirectRootNoLogin'] - return (store.state.users.currentUser ? redirectRootLogin : redirectRootNoLogin) || '/main/all' - }}, - { path: '/main/all', component: PublicAndExternalTimeline }, - { path: '/main/public', component: PublicTimeline }, - { path: '/main/friends', component: FriendsTimeline }, - { path: '/tag/:tag', component: TagTimeline }, - { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } }, - { name: 'user-profile', path: '/users/:id', component: UserProfile }, - { name: 'mentions', path: '/:username/mentions', component: Mentions }, - { name: 'settings', path: '/settings', component: Settings }, - { name: 'registration', path: '/registration', component: Registration }, - { name: 'registration', path: '/registration/:token', component: Registration }, - { name: 'friend-requests', path: '/friend-requests', component: FollowRequests }, - { name: 'user-settings', path: '/user-settings', component: UserSettings } - ] + var theme = (apiStatusnetConfigSitePleromafe.theme || staticConfig.theme) + var background = (apiStatusnetConfigSitePleromafe.background || staticConfig.background) + var logo = (apiStatusnetConfigSitePleromafe.logo || staticConfig.logo) + var redirectRootNoLogin = (apiStatusnetConfigSitePleromafe.redirectRootNoLogin || staticConfig.redirectRootNoLogin) + var redirectRootLogin = (apiStatusnetConfigSitePleromafe.redirectRootLogin || staticConfig.redirectRootLogin) + var chatDisabled = (apiStatusnetConfigSitePleromafe.chatDisabled || staticConfig.chatDisabled) + var showWhoToFollowPanel = (apiStatusnetConfigSitePleromafe.showWhoToFollowPanel || staticConfig.showWhoToFollowPanel) + var whoToFollowProvider = (apiStatusnetConfigSitePleromafe.whoToFollowProvider || staticConfig.whoToFollowProvider) + var whoToFollowLink = (apiStatusnetConfigSitePleromafe.whoToFollowLink || staticConfig.whoToFollowLink) + var showInstanceSpecificPanel = (apiStatusnetConfigSitePleromafe.showInstanceSpecificPanel || staticConfig.showInstanceSpecificPanel) + var scopeOptionsEnabled = (apiStatusnetConfigSitePleromafe.scopeOptionsEnabled || staticConfig.scopeOptionsEnabled) + var collapseMessageWithSubject = (apiStatusnetConfigSitePleromafe.collapseMessageWithSubject || staticConfig.collapseMessageWithSubject) - const router = new VueRouter({ - mode: 'history', - routes, - scrollBehavior: (to, from, savedPosition) => { - if (to.matched.some(m => m.meta.dontScroll)) { - return false - } - return savedPosition || { x: 0, y: 0 } + store.dispatch('setOption', { name: 'theme', value: theme }) + store.dispatch('setOption', { name: 'background', value: background }) + store.dispatch('setOption', { name: 'logo', value: logo }) + store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: showWhoToFollowPanel }) + store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider }) + store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink }) + store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) + store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) + store.dispatch('setOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject }) + if (chatDisabled) { + store.dispatch('disableChat') } - }) - /* eslint-disable no-new */ - new Vue({ - router, - store, - i18n, - el: '#app', - render: h => h(App) + const routes = [ + { name: 'root', + path: '/', + redirect: to => { + return (store.state.users.currentUser ? redirectRootLogin : redirectRootNoLogin) || '/main/all' + }}, + { path: '/main/all', component: PublicAndExternalTimeline }, + { path: '/main/public', component: PublicTimeline }, + { path: '/main/friends', component: FriendsTimeline }, + { path: '/tag/:tag', component: TagTimeline }, + { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } }, + { name: 'user-profile', path: '/users/:id', component: UserProfile }, + { name: 'mentions', path: '/:username/mentions', component: Mentions }, + { name: 'settings', path: '/settings', component: Settings }, + { name: 'registration', path: '/registration', component: Registration }, + { name: 'registration', path: '/registration/:token', component: Registration }, + { name: 'friend-requests', path: '/friend-requests', component: FollowRequests }, + { name: 'user-settings', path: '/user-settings', component: UserSettings } + ] + + const router = new VueRouter({ + mode: 'history', + routes, + scrollBehavior: (to, from, savedPosition) => { + if (to.matched.some(m => m.meta.dontScroll)) { + return false + } + return savedPosition || { x: 0, y: 0 } + } + }) + + /* eslint-disable no-new */ + new Vue({ + router, + store, + i18n, + el: '#app', + render: h => h(App) + }) }) }) From 81c04fac17ed68da799de49af2de37d922071fe1 Mon Sep 17 00:00:00 2001 From: dtluna Date: Fri, 24 Aug 2018 21:21:14 +0300 Subject: [PATCH 20/37] Update Russian translations --- src/i18n/messages.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 2fa0f9100..99efc1ca1 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -1593,6 +1593,8 @@ const ru = { set_new_profile_background: 'Загрузить новый фон профиля', settings: 'Настройки', theme: 'Тема', + export_theme: 'Экспортировать текущую тему', + import_theme: 'Загрузить сохранённую тему', presets: 'Пресеты', theme_help: 'Используйте шестнадцатеричные коды цветов (#rrggbb) для настройки темы.', radii_help: 'Округление краёв элементов интерфейса (в пикселях)', @@ -1641,7 +1643,12 @@ const ru = { confirm_new_password: 'Подтверждение нового пароля', changed_password: 'Пароль изменён успешно.', change_password_error: 'Произошла ошибка при попытке изменить пароль.', - limited_availability: 'Не доступно в вашем браузере' + lock_account_description: 'Аккаунт доступен только подтверждённым подписчикам', + limited_availability: 'Не доступно в вашем браузере', + profile_tab: 'Профиль', + security_tab: 'Безопасность', + data_import_export_tab: 'Импорт / Экспорт данных', + collapse_subject: 'Сворачивать посты с темой' }, notifications: { notifications: 'Уведомления', From 296ab5430147f01107131046dcd428085bef9020 Mon Sep 17 00:00:00 2001 From: scarlett Date: Fri, 24 Aug 2018 20:04:26 +0100 Subject: [PATCH 21/37] Add settings for changing the visibility of replies in the timeline. --- src/components/settings/settings.js | 4 +++ src/components/settings/settings.vue | 10 +++++++ src/components/status/status.js | 42 ++++++++++++++++++++++++++++ src/components/status/status.vue | 2 +- src/i18n/messages.js | 3 ++ src/main.js | 1 + src/modules/config.js | 1 + 7 files changed, 62 insertions(+), 1 deletion(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index c85ef59f6..d5ca33cc1 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -8,6 +8,7 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, + replyVisibilityLocal: this.$store.state.config.replyVisibility, loopVideoLocal: this.$store.state.config.loopVideo, loopVideoSilentOnlyLocal: this.$store.state.config.loopVideoSilentOnly, muteWordsString: this.$store.state.config.muteWords.join('\n'), @@ -44,6 +45,9 @@ const settings = { hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, + replyVisibilityLocal (value) { + this.$store.dispatch('setOption', { name: 'replyVisibility', value }) + }, loopVideoLocal (value) { this.$store.dispatch('setOption', { name: 'loopVideo', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 415317f03..9612876e4 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -38,6 +38,16 @@ +
  • + +
  • diff --git a/src/components/status/status.js b/src/components/status/status.js index 9670f69d2..a6cb6b6fe 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -105,6 +105,48 @@ const Status = { const lengthScore = this.status.statusnet_html.split(/ 20 }, + isReply () { + if (this.status.in_reply_to_status_id) { + return true + } + // For private replies where we can't see the OP, in_reply_to_status_id will be null. + // So instead, check that the post starts with a @mention. + if (this.status.visibility === 'private') { + var textBody = this.status.text + if (this.status.summary !== null) { + textBody = textBody.substring(this.status.summary.length, textBody.length) + } + return textBody.startsWith('@') + } + return false + }, + hideReply () { + if (this.$store.state.config.replyVisibility === 'all') { + return false + } + if (this.inlineExpanded || this.expanded || !this.isReply) { + return false + } + if (this.status.user.id === this.$store.state.users.currentUser.id) { + return false + } + if (this.status.activity_type === 'repeat') { + return false + } + var checkFollowing = this.$store.state.config.replyVisibility === 'following' + for (var i = 0; i < this.status.attentions.length; ++i) { + if (this.status.user.id === this.status.attentions[i].id) { + continue + } + if (checkFollowing && this.status.attentions[i].following) { + return false + } + if (this.status.attentions[i].id === this.$store.state.users.currentUser.id) { + return false + } + } + return this.status.attentions.length > 0 + }, hideSubjectStatus () { if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) { return false diff --git a/src/components/status/status.vue b/src/components/status/status.vue index e7d5ed7ad..2bc44ee7d 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -1,5 +1,5 @@ diff --git a/src/i18n/messages.js b/src/i18n/messages.js index a0b7f5629..625ac1b66 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -384,6 +384,8 @@ const en = { account_not_locked_warning: 'Your account is not {0}. Anyone can follow you to view your follower-only posts.', account_not_locked_warning_link: 'locked', direct_warning: 'This post will only be visible to all the mentioned users.', + attachments_sensitive: 'Attachments marked sensitive', + attachments_not_sensitive: 'Attachments not marked sensitive', scope: { public: 'Public - Post to public timelines', unlisted: 'Unlisted - Do not post to public timelines', diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 92013448c..efea86cf5 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -373,7 +373,7 @@ const unretweet = ({ id, credentials }) => { }) } -const postStatus = ({credentials, status, spoilerText, visibility, mediaIds, inReplyToStatusId}) => { +const postStatus = ({credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId}) => { const idsText = mediaIds.join(',') const form = new FormData() @@ -381,6 +381,7 @@ const postStatus = ({credentials, status, spoilerText, visibility, mediaIds, inR form.append('source', 'Pleroma FE') if (spoilerText) form.append('spoiler_text', spoilerText) if (visibility) form.append('visibility', visibility) + if (sensitive) form.append('sensitive', sensitive) form.append('media_ids', idsText) if (inReplyToStatusId) { form.append('in_reply_to_status_id', inReplyToStatusId) diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js index 3381e9e22..c3bbbaa33 100644 --- a/src/services/status_poster/status_poster.service.js +++ b/src/services/status_poster/status_poster.service.js @@ -1,10 +1,10 @@ import { map } from 'lodash' import apiService from '../api/api.service.js' -const postStatus = ({ store, status, spoilerText, visibility, media = [], inReplyToStatusId = undefined }) => { +const postStatus = ({ store, status, spoilerText, visibility, sensitive, media = [], inReplyToStatusId = undefined }) => { const mediaIds = map(media, 'id') - return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, mediaIds, inReplyToStatusId}) + return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId}) .then((data) => data.json()) .then((data) => { if (!data.error) { From a81c3b1324f496d8571ca4372299c9bb4a263d1a Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sun, 26 Aug 2018 06:54:03 +0900 Subject: [PATCH 29/37] fix typo --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index f8144facf..e4a96c55e 100644 --- a/src/main.js +++ b/src/main.js @@ -97,7 +97,7 @@ window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { var apiStatusnetConfigSitePleromafe = data.site.pleromafe - window.fetch('/static/sonfig.json') + window.fetch('/static/config.json') .then((data) => { var staticConfig = data From a3cc78115ce36d1db7ff6fdad65683ebd28f133c Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sun, 26 Aug 2018 06:56:52 +0900 Subject: [PATCH 30/37] rename apiStatusnetConfigSitePleromafe to apiConfig --- src/main.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main.js b/src/main.js index e4a96c55e..8681e9607 100644 --- a/src/main.js +++ b/src/main.js @@ -96,23 +96,23 @@ window.fetch('/api/statusnet/config.json') window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { - var apiStatusnetConfigSitePleromafe = data.site.pleromafe + var apiConfig = data.site.pleromafe window.fetch('/static/config.json') .then((data) => { var staticConfig = data - var theme = (apiStatusnetConfigSitePleromafe.theme || staticConfig.theme) - var background = (apiStatusnetConfigSitePleromafe.background || staticConfig.background) - var logo = (apiStatusnetConfigSitePleromafe.logo || staticConfig.logo) - var redirectRootNoLogin = (apiStatusnetConfigSitePleromafe.redirectRootNoLogin || staticConfig.redirectRootNoLogin) - var redirectRootLogin = (apiStatusnetConfigSitePleromafe.redirectRootLogin || staticConfig.redirectRootLogin) - var chatDisabled = (apiStatusnetConfigSitePleromafe.chatDisabled || staticConfig.chatDisabled) - var showWhoToFollowPanel = (apiStatusnetConfigSitePleromafe.showWhoToFollowPanel || staticConfig.showWhoToFollowPanel) - var whoToFollowProvider = (apiStatusnetConfigSitePleromafe.whoToFollowProvider || staticConfig.whoToFollowProvider) - var whoToFollowLink = (apiStatusnetConfigSitePleromafe.whoToFollowLink || staticConfig.whoToFollowLink) - var showInstanceSpecificPanel = (apiStatusnetConfigSitePleromafe.showInstanceSpecificPanel || staticConfig.showInstanceSpecificPanel) - var scopeOptionsEnabled = (apiStatusnetConfigSitePleromafe.scopeOptionsEnabled || staticConfig.scopeOptionsEnabled) - var collapseMessageWithSubject = (apiStatusnetConfigSitePleromafe.collapseMessageWithSubject || staticConfig.collapseMessageWithSubject) + var theme = (apiConfig.theme || staticConfig.theme) + var background = (apiConfig.background || staticConfig.background) + var logo = (apiConfig.logo || staticConfig.logo) + var redirectRootNoLogin = (apiConfig.redirectRootNoLogin || staticConfig.redirectRootNoLogin) + var redirectRootLogin = (apiConfig.redirectRootLogin || staticConfig.redirectRootLogin) + var chatDisabled = (apiConfig.chatDisabled || staticConfig.chatDisabled) + var showWhoToFollowPanel = (apiConfig.showWhoToFollowPanel || staticConfig.showWhoToFollowPanel) + var whoToFollowProvider = (apiConfig.whoToFollowProvider || staticConfig.whoToFollowProvider) + var whoToFollowLink = (apiConfig.whoToFollowLink || staticConfig.whoToFollowLink) + var showInstanceSpecificPanel = (apiConfig.showInstanceSpecificPanel || staticConfig.showInstanceSpecificPanel) + var scopeOptionsEnabled = (apiConfig.scopeOptionsEnabled || staticConfig.scopeOptionsEnabled) + var collapseMessageWithSubject = (apiConfig.collapseMessageWithSubject || staticConfig.collapseMessageWithSubject) store.dispatch('setOption', { name: 'theme', value: theme }) store.dispatch('setOption', { name: 'background', value: background }) From 8b9e973a557ab9c30c677c3ba5e8a966555cc1e9 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sun, 26 Aug 2018 07:00:23 +0900 Subject: [PATCH 31/37] save /api/statusnet/config.json connection --- src/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main.js b/src/main.js index 8681e9607..a988f66c7 100644 --- a/src/main.js +++ b/src/main.js @@ -91,11 +91,7 @@ window.fetch('/api/statusnet/config.json') store.dispatch('setOption', { name: 'registrationOpen', value: (registrationClosed === '0') }) store.dispatch('setOption', { name: 'textlimit', value: parseInt(textlimit) }) store.dispatch('setOption', { name: 'server', value: server }) - }) -window.fetch('/api/statusnet/config.json') - .then((res) => res.json()) - .then((data) => { var apiConfig = data.site.pleromafe window.fetch('/static/config.json') .then((data) => { From c6913e3909e089225ade7aa4874bd1acbca5a5e4 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sun, 26 Aug 2018 07:01:56 +0900 Subject: [PATCH 32/37] correct /static/config.json decoding --- src/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.js b/src/main.js index a988f66c7..48022c413 100644 --- a/src/main.js +++ b/src/main.js @@ -93,7 +93,9 @@ window.fetch('/api/statusnet/config.json') store.dispatch('setOption', { name: 'server', value: server }) var apiConfig = data.site.pleromafe + window.fetch('/static/config.json') + .then((res) => res.json()) .then((data) => { var staticConfig = data From 52ce86ed573deede5e762f4096ef02ee87b04e88 Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 26 Aug 2018 00:21:54 +0100 Subject: [PATCH 33/37] Don't use nsfw clickthrough if the post is collapsed by default. --- src/components/status/status.js | 9 +++++++++ src/components/status/status.vue | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 11b8febab..7aa1e03b5 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -164,6 +164,15 @@ const Status = { showingMore () { return this.showingTall || (this.status.summary && this.expandingSubject) }, + nsfwClickthrough () { + if (!this.status.nsfw) { + return false + } + if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + return false + } + return true + }, attachmentSize () { if ((this.$store.state.config.hideAttachments && !this.inConversation) || (this.$store.state.config.hideAttachmentsInConv && this.inConversation)) { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index e8951220d..c7ef92a2c 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -84,7 +84,7 @@
    - +
    From 54ac0dfefd168bcdc08d533684a6a6a7fcf69cbc Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 26 Aug 2018 01:50:11 +0100 Subject: [PATCH 34/37] Preserve subject in replies. --- src/components/post_status_form/post_status_form.js | 4 +++- src/components/status/status.js | 6 ++++++ src/components/status/status.vue | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index cbff7827d..7d40bc3cc 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -24,7 +24,8 @@ const PostStatusForm = { 'replyTo', 'repliedUser', 'attentions', - 'messageScope' + 'messageScope', + 'subject' ], components: { MediaUpload @@ -52,6 +53,7 @@ const PostStatusForm = { posting: false, highlighted: 0, newStatus: { + spoilerText: this.subject, status: statusText, nsfw: false, files: [], diff --git a/src/components/status/status.js b/src/components/status/status.js index 7aa1e03b5..a6c49f7cd 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -173,6 +173,12 @@ const Status = { } return true }, + replySubject () { + if (this.status.summary && !this.status.summary.match(/^re[: ]/i)) { + return 're: '.concat(this.status.summary) + } + return this.status.summary + }, attachmentSize () { if ((this.$store.state.config.hideAttachments && !this.inConversation) || (this.$store.state.config.hideAttachmentsInConv && this.inConversation)) { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index c7ef92a2c..123b0cc29 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -102,7 +102,7 @@
    - +
    From 7fc4506d29ac12910d32aaaac78479b1d9ba3b11 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Sun, 26 Aug 2018 17:32:58 +0900 Subject: [PATCH 35/37] remove-unused-settings --- static/config.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/static/config.json b/static/config.json index 62b85aae5..afcb01636 100644 --- a/static/config.json +++ b/static/config.json @@ -5,11 +5,6 @@ "redirectRootNoLogin": "/main/all", "redirectRootLogin": "/main/friends", "chatDisabled": false, - "showWhoToFollowPanel": false, - "whoToFollowProvider": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}", - "whoToFollowProviderDummy2": "https://followlink.osa-p.net/api/get_recommend.json?acct=@{{user}}@{{host}}", - "whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}", - "whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html", "showInstanceSpecificPanel": false, "scopeOptionsEnabled": false, "collapseMessageWithSubject": false From b68ebf3056c7fed2f8d30728efb74518c07b6bef Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 26 Aug 2018 13:50:36 +0100 Subject: [PATCH 36/37] Match emoji using startsWith instead of match. --- src/components/post_status_form/post_status_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 7d40bc3cc..1fca49502 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -89,7 +89,7 @@ const PostStatusForm = { })) } else if (firstchar === ':') { if (this.textAtCaret === ':') { return } - const matchedEmoji = filter(this.emoji.concat(this.customEmoji), (emoji) => emoji.shortcode.match(this.textAtCaret.slice(1))) + const matchedEmoji = filter(this.emoji.concat(this.customEmoji), (emoji) => emoji.shortcode.startsWith(this.textAtCaret.slice(1))) if (matchedEmoji.length <= 0) { return false } From 74a6df8a551e1103e3ed70d2561dd3a488fba17e Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 26 Aug 2018 13:51:21 +0100 Subject: [PATCH 37/37] Match users using startsWith instead of match. --- src/components/post_status_form/post_status_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 1fca49502..06a428fff 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -75,7 +75,7 @@ const PostStatusForm = { const firstchar = this.textAtCaret.charAt(0) if (firstchar === '@') { const matchedUsers = filter(this.users, (user) => (String(user.name + user.screen_name)).toUpperCase() - .match(this.textAtCaret.slice(1).toUpperCase())) + .startsWith(this.textAtCaret.slice(1).toUpperCase())) if (matchedUsers.length <= 0) { return false }