Add: follow request on notification

This commit is contained in:
cutls 2019-12-17 01:11:12 +09:00
parent 4bcb8104de
commit b2d98948d2
6 changed files with 42 additions and 11 deletions

View File

@ -374,6 +374,31 @@ iframe,
grid-area: side; 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 { .quote-inline {
display: none; display: none;
} }

View File

@ -94,7 +94,6 @@ function media(b64, type, no, stamped) {
postMessage(['stampImage', [b64, user + '@' + domain]], '*') postMessage(['stampImage', [b64, user + '@' + domain]], '*')
return false return false
} }
console.log(b64)
var l = 4 var l = 4
var c = 'abcdefghijklmnopqrstuvwxyz0123456789' var c = 'abcdefghijklmnopqrstuvwxyz0123456789'
var cl = c.length var cl = c.length

View File

@ -70,12 +70,14 @@ function notfColumn(acct_id, tlid, sys) {
} }
var mute = getFilterTypeByAcct(acct_id, 'notif') var mute = getFilterTypeByAcct(acct_id, 'notif')
//Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ //Pleromaにはmoveというtypeがあるらしい。何が互換APIじゃ
if (obj.type != 'follow' && obj.type != 'move') { if (obj.type != 'follow' && obj.type != 'move' && obj.type != 'follow_request') {
if (misskey) { if (misskey) {
templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute) templete = templete + misskeyParse([obj], 'notf', acct_id, tlid, -1, mute)
} else { } else {
templete = templete + parse([obj], 'notf', acct_id, tlid, -1, mute) 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 { } else {
if (misskey) { if (misskey) {
templete = templete + misskeyUserparse([obj], 'notf', acct_id, tlid, -1, mute) templete = templete + misskeyUserparse([obj], 'notf', acct_id, tlid, -1, mute)

View File

@ -1060,7 +1060,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</a> </a>
</div> </div>
<div class="action ${can_rt} ${disp['rt']} ${noauth}"> <div class="action ${can_rt} ${disp['rt']} ${noauth}">
<a onclick="rt('${toot.id}','${acct_id}','${tlid}')" class="waves-effect waves-dark btn-flat actct bt-btn" <a onclick="rt('${
toot.id
}','${acct_id}','${tlid}')" class="waves-effect waves-dark btn-flat actct bt-btn"
style="padding:0" title="${lang.lang_parse_bt}"> style="padding:0" title="${lang.lang_parse_bt}">
<i class="fas fa-retweet ${if_rt} rt_${toot.id}"></i> <i class="fas fa-retweet ${if_rt} rt_${toot.id}"></i>
<span class="rt_ct">${toot.reblogs_count}</span> <span class="rt_ct">${toot.reblogs_count}</span>
@ -1199,6 +1201,8 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} }
} else if (auth == 'moved') { } else if (auth == 'moved') {
var ftxt = lang.lang_parse_moved var ftxt = lang.lang_parse_moved
} else if (auth == 'request') {
var ftxt = lang.lang_parse_request
} }
console.log(auth, ftxt) console.log(auth, ftxt)
if (popup > 0 || popup == -1 || notf) { if (popup > 0 || popup == -1 || notf) {
@ -1281,7 +1285,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} }
templete = templete =
templete + templete +
`<div class="cvo" style="padding-top:5px;" user-id="${toot.id}"> `<div class="cusr" style="padding-top:5px;" user-id="${toot.id}">
<div class="area-notice">${notftext}</div> <div class="area-notice">${notftext}</div>
<div class="area-icon"> <div class="area-icon">
${udg} ${udg}
@ -1301,21 +1305,20 @@ function userparse(obj, auth, acct_id, tlid, popup) {
class="sml gray" class="sml gray"
style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"
> >
@ ${toot.acct}${locked}</span @ ${toot.acct}${locked}</span>
>
</div> </div>
</div> </div>
<div class="area-toot acct-note"> <div class="area-status">
${toot.note.replace(/<br\s?\/?>.+/g, '<span class="gray">...</span>')}
</div>
<div style="justify-content:space-around;top:5px" class="area-actions">
<div class="cbadge" style="width:100px;"> <div class="cbadge" style="width:100px;">
${lang.lang_status_follow}:${toot.following_count} ${lang.lang_status_follow}:${toot.following_count}
</div> </div>
<div class="cbadge" style="width:100px;"> <div class="cbadge" style="width:100px;">
${lang.lang_status_followers}:${toot.followers_count} ${lang.lang_status_followers}:${toot.followers_count}
</div> </div>
${latesthtml}${authhtml} ${latesthtml}
</div>
<div class="area-actions" style="justify-content: flex-end;">
${authhtml}
</div> </div>
</div> </div>
` `

View File

@ -154,6 +154,7 @@
"lang_showontl_movebtn": "Continue on the new account", "lang_showontl_movebtn": "Continue on the new account",
"lang_showontl_botacct": "[bot]", "lang_showontl_botacct": "[bot]",
"lang_showontl_followed": "Following you", "lang_showontl_followed": "Following you",
"lang_parse_request": "Follow request",
"lang_showontl_notf": "Notification ", "lang_showontl_notf": "Notification ",
"lang_showontl_domain": "Domain ", "lang_showontl_domain": "Domain ",
"lang_showontl_listwarn": "Follow to add this user to lists.", "lang_showontl_listwarn": "Follow to add this user to lists.",

View File

@ -154,6 +154,7 @@
"lang_showontl_movebtn": "移行先を見る", "lang_showontl_movebtn": "移行先を見る",
"lang_showontl_botacct": "botアカウント", "lang_showontl_botacct": "botアカウント",
"lang_showontl_followed": "フォローされています", "lang_showontl_followed": "フォローされています",
"lang_parse_request": "フォローリクエスト",
"lang_showontl_notf": "通知", "lang_showontl_notf": "通知",
"lang_showontl_domain": "ドメイン", "lang_showontl_domain": "ドメイン",
"lang_showontl_listwarn": "リストに追加するためにはフォローが必要です。", "lang_showontl_listwarn": "リストに追加するためにはフォローが必要です。",