From b2d98948d25cdceeec080e847a4862327ae4dac6 Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 17 Dec 2019 01:11:12 +0900 Subject: [PATCH] Add: follow request on notification --- app/css/tl.css | 25 +++++++++++++++++++++++++ app/js/post/img.js | 1 - app/js/tl/notification.js | 4 +++- app/js/tl/parse.js | 21 ++++++++++++--------- app/view/make/language/en/main.json | 1 + app/view/make/language/ja/main.json | 1 + 6 files changed, 42 insertions(+), 11 deletions(-) diff --git a/app/css/tl.css b/app/css/tl.css index c7442bcf..1c70c91e 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -374,6 +374,31 @@ iframe, grid-area: side; } +.cusr { + user-select: text; + padding-left: 5px; + border-bottom: 0.5px solid; + padding-right: 2px; + word-break: break-word; + width: 100%; + display: grid; + grid-template-columns: 43px 2fr 1fr; + grid-template-rows: auto 1.6rem 2fr auto; + grid-template-areas: 'notice notice notice' 'icon display_name display_name' 'space status status' 'space actions actions'; +} + +.area-status { + grid-area: status; + display: flex; + flex-wrap: wrap; + margin-bottom: 5px; +} + +.cusr .cbadge { + margin-top: 6px; + margin-left: 6px; +} + .quote-inline { display: none; } diff --git a/app/js/post/img.js b/app/js/post/img.js index 7d6a7cd9..035e8489 100644 --- a/app/js/post/img.js +++ b/app/js/post/img.js @@ -94,7 +94,6 @@ function media(b64, type, no, stamped) { postMessage(['stampImage', [b64, user + '@' + domain]], '*') return false } - console.log(b64) var l = 4 var c = 'abcdefghijklmnopqrstuvwxyz0123456789' var cl = c.length diff --git a/app/js/tl/notification.js b/app/js/tl/notification.js index b3358c41..ec07b58a 100644 --- a/app/js/tl/notification.js +++ b/app/js/tl/notification.js @@ -70,12 +70,14 @@ function notfColumn(acct_id, tlid, sys) { } var mute = getFilterTypeByAcct(acct_id, 'notif') //Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ - if (obj.type != 'follow' && obj.type != 'move') { + if (obj.type != 'follow' && obj.type != 'move' && obj.type != 'follow_request') { if (misskey) { templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute) } else { templete = templete + parse([obj], 'notf', acct_id, tlid, -1, mute) } + } else if (obj.type == 'follow_request') { + templete = templete + userparse([obj.account], 'request', acct_id, tlid, -1) } else { if (misskey) { templete = templete + misskeyUserparse([obj], 'notf', acct_id, tlid, -1, mute) diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index e78fb055..2f77777a 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1060,7 +1060,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
- ${toot.reblogs_count} @@ -1199,6 +1201,8 @@ function userparse(obj, auth, acct_id, tlid, popup) { } } else if (auth == 'moved') { var ftxt = lang.lang_parse_moved + } else if (auth == 'request') { + var ftxt = lang.lang_parse_request } console.log(auth, ftxt) if (popup > 0 || popup == -1 || notf) { @@ -1281,7 +1285,7 @@ function userparse(obj, auth, acct_id, tlid, popup) { } templete = templete + - `
+ `
${notftext}
${udg} @@ -1301,21 +1305,20 @@ function userparse(obj, auth, acct_id, tlid, popup) { class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;" > - @ ${toot.acct}${locked} + @ ${toot.acct}${locked}
-
- ${toot.note.replace(/.+/g, '...')} -
-
+
${lang.lang_status_follow}:${toot.following_count}
${lang.lang_status_followers}:${toot.followers_count}
- ${latesthtml}${authhtml} + ${latesthtml} +
+
+ ${authhtml}
` diff --git a/app/view/make/language/en/main.json b/app/view/make/language/en/main.json index 9cd730b3..126818ad 100644 --- a/app/view/make/language/en/main.json +++ b/app/view/make/language/en/main.json @@ -154,6 +154,7 @@ "lang_showontl_movebtn": "Continue on the new account", "lang_showontl_botacct": "[bot]", "lang_showontl_followed": "Following you", + "lang_parse_request": "Follow request", "lang_showontl_notf": "Notification ", "lang_showontl_domain": "Domain ", "lang_showontl_listwarn": "Follow to add this user to lists.", diff --git a/app/view/make/language/ja/main.json b/app/view/make/language/ja/main.json index 7efb8ca1..93f4f00f 100644 --- a/app/view/make/language/ja/main.json +++ b/app/view/make/language/ja/main.json @@ -154,6 +154,7 @@ "lang_showontl_movebtn": "移行先を見る", "lang_showontl_botacct": "botアカウント", "lang_showontl_followed": "フォローされています", + "lang_parse_request": "フォローリクエスト", "lang_showontl_notf": "通知", "lang_showontl_domain": "ドメイン", "lang_showontl_listwarn": "リストに追加するためにはフォローが必要です。",