thedesk/app/js/tl/misskeyparse.js

1054 lines
40 KiB
JavaScript
Raw Normal View History

2018-12-09 05:46:01 +11:00
function escapeHTMLtemp(str) {
2019-05-08 01:48:59 +10:00
if (!str) {
2020-08-02 17:08:07 +10:00
return ""
2018-12-09 05:46:01 +11:00
}
2019-05-08 01:48:59 +10:00
return str.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
2020-08-02 17:08:07 +10:00
.replace(/'/g, '&#039;')
2018-12-09 05:46:01 +11:00
}
2019-05-08 01:48:59 +10:00
$.strip_tagstemp = function (str, allowed) {
if (!str) {
2020-08-02 17:08:07 +10:00
return ""
2018-12-09 05:46:01 +11:00
}
2019-05-08 01:48:59 +10:00
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || [])
2020-08-02 17:08:07 +10:00
.join('')
2019-05-08 01:48:59 +10:00
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
2020-08-02 17:08:07 +10:00
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi
2019-05-08 01:48:59 +10:00
return str.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
2020-08-02 17:08:07 +10:00
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''
})
}
2018-07-30 21:03:49 +10:00
//オブジェクトパーサー(トゥート)
function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
2020-08-02 17:08:07 +10:00
var templete = ''
localStorage.setItem("lastunix_" + tlid, date(obj[0].createdAt, 'unix'))
var actb = localStorage.getItem("action_btns")
var actb = 're,rt,fav,qt,del,pin,red'
2019-05-08 01:48:59 +10:00
if (actb) {
2020-08-02 17:08:07 +10:00
var actb = actb.split(',')
var disp = {}
2019-05-08 01:48:59 +10:00
for (var k = 0; k < actb.length; k++) {
if (k < 4) {
2020-08-02 17:08:07 +10:00
var tp = "type-a"
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var tp = "type-b"
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
disp[actb[k]] = tp
2018-07-30 21:03:49 +10:00
}
}
2020-08-02 17:08:07 +10:00
var datetype = localStorage.getItem("datetype")
var nsfwtype = localStorage.getItem("nsfw")
var sent = localStorage.getItem("sentence")
var ltr = localStorage.getItem("letters")
var gif = localStorage.getItem("gif")
var imh = localStorage.getItem("img-height")
2018-07-30 21:03:49 +10:00
//ネイティブ通知
2020-08-02 17:08:07 +10:00
var native = localStorage.getItem("nativenotf")
2019-05-08 01:48:59 +10:00
if (!native) {
2020-08-02 17:08:07 +10:00
native = "yes"
2018-07-30 21:03:49 +10:00
}
//クライアント強調
2020-08-02 17:08:07 +10:00
var empCli = localStorage.getItem("client_emp")
2019-06-22 00:17:56 +10:00
if (empCli) {
2020-08-02 17:08:07 +10:00
var empCli = JSON.parse(empCli)
2019-06-26 00:16:36 +10:00
} else {
2020-08-02 17:08:07 +10:00
var empCli = []
2018-07-30 21:03:49 +10:00
}
//クライアントミュート
2020-08-02 17:08:07 +10:00
var muteCli = localStorage.getItem("client_mute")
2019-06-22 00:17:56 +10:00
if (muteCli) {
2020-08-02 17:08:07 +10:00
var muteCli = JSON.parse(muteCli)
2019-06-26 00:16:36 +10:00
} else {
2020-08-02 17:08:07 +10:00
var muteCli = []
2018-07-30 21:03:49 +10:00
}
//ユーザー強調
2020-08-02 17:08:07 +10:00
var useremp = localStorage.getItem("user_emp")
2019-05-08 01:48:59 +10:00
if (useremp) {
2020-08-02 17:08:07 +10:00
var useremp = JSON.parse(useremp)
2018-07-30 21:03:49 +10:00
}
//ワード強調
2020-08-02 17:08:07 +10:00
var wordempList = localStorage.getItem("word_emp")
2019-06-22 00:17:56 +10:00
if (wordempList) {
2020-08-02 17:08:07 +10:00
var wordempList = JSON.parse(wordempList)
2018-07-30 21:03:49 +10:00
}
//ワードミュート
2020-08-02 17:08:07 +10:00
var wordmuteList = localStorage.getItem("word_mute")
2019-06-22 00:17:56 +10:00
if (wordmuteList) {
2020-08-02 17:08:07 +10:00
var wordmuteList = JSON.parse(wordmuteList)
2019-06-22 00:17:56 +10:00
if (wordmuteList) {
2020-08-02 17:08:07 +10:00
wordmuteList = wordmuteList.concat(mutefilter)
2019-06-22 00:17:56 +10:00
}
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
wordmuteList = mutefilter
2018-07-30 21:03:49 +10:00
}
2018-12-09 05:46:01 +11:00
//Ticker
2020-08-02 17:08:07 +10:00
var tickerck = localStorage.getItem("ticker_ok")
2019-05-08 01:48:59 +10:00
if (tickerck) {
2020-08-02 17:08:07 +10:00
var ticker = true
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var ticker = false
2018-12-09 05:46:01 +11:00
}
2018-07-30 21:03:49 +10:00
if (!sent) {
2020-08-02 17:08:07 +10:00
var sent = 500
2018-07-30 21:03:49 +10:00
}
if (!ltr) {
2020-08-02 17:08:07 +10:00
var ltr = 500
2018-07-30 21:03:49 +10:00
}
if (!nsfwtype || nsfwtype == "yes") {
2020-08-02 17:08:07 +10:00
var nsfw = "ok"
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var nsfw
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var cwtype = localStorage.getItem("cw")
2018-07-30 21:03:49 +10:00
if (!cwtype || cwtype == "yes") {
2020-08-02 17:08:07 +10:00
var cw = "ok"
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var cw
2018-07-30 21:03:49 +10:00
}
if (!datetype) {
2020-08-02 17:08:07 +10:00
datetype = "absolute"
2018-07-30 21:03:49 +10:00
}
if (!gif) {
2020-08-02 17:08:07 +10:00
var gif = "yes"
2018-07-30 21:03:49 +10:00
}
if (!imh) {
2020-08-02 17:08:07 +10:00
var imh = "200"
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (!emp) {
2020-08-02 17:08:07 +10:00
var emp = []
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (!mute) {
2020-08-02 17:08:07 +10:00
var mute = []
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (!useremp) {
2020-08-02 17:08:07 +10:00
var useremp = []
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (!wordemp) {
2020-08-02 17:08:07 +10:00
var wordemp = []
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (!wordmute) {
2020-08-02 17:08:07 +10:00
var wordmute = []
2018-07-30 21:03:49 +10:00
}
//via通知
2020-08-02 17:08:07 +10:00
var viashow = localStorage.getItem("viashow")
2019-05-08 01:48:59 +10:00
if (!viashow) {
2020-08-02 17:08:07 +10:00
viashow = "via-hide"
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (viashow == "hide") {
2020-08-02 17:08:07 +10:00
viashow = "via-hide"
2018-07-30 21:03:49 +10:00
}
//認証なしTL
2019-05-08 01:48:59 +10:00
if (mix == "noauth") {
2020-08-02 17:08:07 +10:00
var noauth = "hide"
var antinoauth = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var noauth = ""
var antinoauth = "hide"
2018-07-30 21:03:49 +10:00
}
//マウスオーバーのみ
2020-08-02 17:08:07 +10:00
var mouseover = localStorage.getItem("mouseover")
2019-05-08 01:48:59 +10:00
if (!mouseover) {
2020-08-02 17:08:07 +10:00
mouseover = ""
2019-05-08 01:48:59 +10:00
} else if (mouseover == "yes" || mouseover == "click") {
2020-08-02 17:08:07 +10:00
mouseover = "hide"
2019-05-08 01:48:59 +10:00
} else if (mouseover == "no") {
2020-08-02 17:08:07 +10:00
mouseover = ""
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var local = []
var times = []
2019-05-08 01:48:59 +10:00
Object.keys(obj).forEach(function (key) {
2020-08-02 17:08:07 +10:00
var toot = obj[key]
var dis_name = toot.user.name
2019-05-08 01:48:59 +10:00
if (dis_name) {
2020-08-02 17:08:07 +10:00
dis_name = escapeHTMLtemp(dis_name)
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
disname = ""
2018-08-29 20:17:34 +10:00
}
2019-04-11 03:59:13 +10:00
//絵文字があれば
2019-05-08 01:48:59 +10:00
if (toot.user.emojis) {
Object.keys(toot.user.emojis).forEach(function (key5) {
2020-08-02 17:08:07 +10:00
var emoji = toot.user.emojis[key5]
var shortcode = emoji.name
2019-04-14 04:06:59 +10:00
var emoji_url = '<img draggable="false" src="' + emoji.url +
2020-08-02 17:08:07 +10:00
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">'
var regExp = new RegExp(":" + shortcode + ":", "g")
dis_name = dis_name.replace(regExp, emoji_url)
})
2019-04-14 04:06:59 +10:00
}
2018-07-30 21:03:49 +10:00
if (mix == "notf") {
2018-08-23 03:29:39 +10:00
if (gif == "yes") {
2020-08-02 17:08:07 +10:00
noticeavatar = toot.user.avatarUrl
2018-08-23 03:29:39 +10:00
} else {
2020-08-02 17:08:07 +10:00
noticeavatar = toot.user.avatarUrl
2018-08-23 03:29:39 +10:00
}
2019-05-08 01:48:59 +10:00
noticeavatar = '<a onclick="udg(\'' + toot.user.id +
2019-08-21 01:02:29 +10:00
'\',' + acct_id + ');" user="' + toot.user.username + '" class="udg notf-icon">' +
2019-05-08 01:48:59 +10:00
'<img src="' + noticeavatar +
2020-05-23 14:54:51 +10:00
'" width="20" class="prof-img" user="' + toot.user.username +
2020-08-02 17:08:07 +10:00
'"></a>'
2018-07-30 21:03:49 +10:00
if (toot.type == "reply") {
2020-08-02 17:08:07 +10:00
var what = lang.lang_parse_mentioned
var icon = '<i class="big-text fas fa-share teal-text"></i>'
noticeavatar = ""
2018-07-30 21:03:49 +10:00
} else if (toot.type == "renote") {
2020-08-02 17:08:07 +10:00
var what = lang.lang_misskeyparse_renoted
var icon = '<i class="big-text fas fa-retweet light-blue-text"></i>'
2019-05-08 01:48:59 +10:00
} else if (toot.type == "quote") {
2020-08-02 17:08:07 +10:00
var what = lang.lang_misskeyparse_quoted
var icon = '<i class="big-text fas fa-quote-right orange-text"></i>'
2018-07-30 21:03:49 +10:00
} else if (toot.type == "reaction") {
2020-08-02 17:08:07 +10:00
var what = lang.lang_misskeyparse_reacted
2019-05-08 01:48:59 +10:00
var reactions = {
"like": "👍",
"love": "💓",
"laugh": "😁",
"hmm": "🤔",
"surprise": "😮",
"congrats": "🎉",
"amgry": "💢",
"confused": "😥",
2019-05-09 01:31:05 +10:00
"rip": "😇"
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var icon = reactions[toot.reaction]
var emojisData = JSON.parse(localStorage.getItem("emoji_" + acct_id))
2019-05-08 01:48:59 +10:00
if (!icon) {
if (emojisData) {
2020-08-02 17:08:07 +10:00
var num = emojisData.length
var ehtml = ""
2019-05-08 01:48:59 +10:00
for (i = 0; i < num; i++) {
2020-08-02 17:08:07 +10:00
var emoji = emojisData[i]
2019-05-08 01:48:59 +10:00
if (":" + emoji.shortcode + ":" == toot.reaction) {
if (emoji) {
2020-08-02 17:08:07 +10:00
icon = '<img src="' + emoji.url + '" style="width:1rem">'
2019-04-11 03:59:13 +10:00
}
2019-05-08 01:48:59 +10:00
}
2019-04-11 03:59:13 +10:00
}
2019-05-08 01:48:59 +10:00
}
2019-04-11 03:59:13 +10:00
}
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var icon = '<i class="big-text material-icons indigo-text" style="font-size:17px">info</i>'
2018-07-30 21:03:49 +10:00
}
var noticetext = '<span class="cbadge cbadge-hover"title="' + date(toot.createdAt,
2019-05-08 01:48:59 +10:00
'absolute') + '(' + lang.lang_parse_notftime + ')"><i class="far fa-clock"></i>' + date(toot.createdAt,
datetype) +
'</span>' + icon + '<a onclick="udg(\'' + toot.user.username +
2018-07-30 21:03:49 +10:00
'\',\'' + acct_id + '\')" class="pointer grey-text">' + dis_name +
"(@" + toot.user.username +
2020-08-02 17:08:07 +10:00
")</a>"
var notice = noticetext
var memory = localStorage.getItem("notice-mem")
2018-07-30 21:03:49 +10:00
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
2019-05-08 01:48:59 +10:00
if (localStorage.getItem("hasNotfC_" + acct_id) != "true") {
if (toot.type == "reply") {
var replyct = localStorage.getItem("notf-reply_" + acct_id)
2020-08-02 17:08:07 +10:00
$(".notf-reply_" + acct_id).text(replyct * 1 - (-1))
2019-05-08 01:48:59 +10:00
localStorage.setItem("notf-reply_" + acct_id, replyct * 1 - (-1))
$(".notf-reply_" + acct_id).removeClass("hide")
} else if (toot.type == "renote" || toot.type == "quote") {
var btct = localStorage.getItem("notf-bt_" + acct_id)
2020-08-02 17:08:07 +10:00
$(".notf-bt_" + acct_id).text(btct * 1 + 1)
2019-05-08 01:48:59 +10:00
localStorage.setItem("notf-bt_" + acct_id, btct * 1 - (-1))
$(".notf-bt_" + acct_id).removeClass("hide")
} else if (toot.type == "reaction") {
var favct = localStorage.getItem("notf-fav_" + acct_id)
2020-08-02 17:08:07 +10:00
$(".notf-fav_" + acct_id).text(favct * 1 - (-1))
2019-05-08 01:48:59 +10:00
localStorage.setItem("notf-fav_" + acct_id, favct * 1 - (-1))
$(".notf-fav_" + acct_id).removeClass("hide")
}
2018-08-17 03:21:40 +10:00
}
2020-08-02 17:08:07 +10:00
var domain = localStorage.getItem("domain_" + acct_id)
2019-05-08 01:48:59 +10:00
if (popup > 0) {
2019-06-07 02:11:04 +10:00
M.toast({ html: "[" + domain + "]" + escapeHTMLtemp(toot.user.name) + what, displayLength: popup * 1000 })
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (native == "yes") {
2020-08-02 17:08:07 +10:00
var os = localStorage.getItem("platform")
2018-07-30 21:03:49 +10:00
var options = {
2019-05-08 01:48:59 +10:00
body: toot.user.name + "(" + toot.user.username + ")" + what + "\n\n" + $.strip_tagstemp(toot.note.text),
2019-04-11 03:59:13 +10:00
icon: toot.user.avatarUrl
2020-08-02 17:08:07 +10:00
}
var n = new Notification('TheDesk:' + domain, options)
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (localStorage.getItem("hasNotfC_" + acct_id) != "true") {
2020-08-02 17:08:07 +10:00
$(".notf-icon_" + acct_id).addClass("red-text")
2018-08-17 03:21:40 +10:00
}
2020-08-02 17:08:07 +10:00
localStorage.setItem("notice-mem", noticetext)
noticetext = ""
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var if_notf = 'data-notfIndv="' + acct_id + "_" + toot.id + '"'
var toot = toot.note
var dis_name = escapeHTML(toot.user.name)
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var if_notf = ""
2018-07-30 21:03:49 +10:00
if (toot.renote) {
2020-08-02 17:08:07 +10:00
var rebtxt = lang.lang_parse_btedsimple
var rticon = "fa-retweet light-blue-text"
2019-05-08 01:48:59 +10:00
var notice = '<i class="big-text fas ' + rticon + '"></i>' + dis_name + "(@" + toot.user.username +
2020-08-02 17:08:07 +10:00
")<br>"
var boostback = "shared"
var uniqueid = toot.id
2019-05-08 01:48:59 +10:00
if (!toot.text) {
2020-08-02 17:08:07 +10:00
var toot = toot.renote
2019-04-15 01:45:04 +10:00
}
2020-08-02 17:08:07 +10:00
var dis_name = escapeHTML(toot.user.name)
var uniqueid = toot.id
2019-05-08 01:48:59 +10:00
var actemojick = false
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var uniqueid = toot.id
var notice = ""
var boostback = ""
2018-07-30 21:03:49 +10:00
//ユーザー強調
2019-05-08 01:48:59 +10:00
if (toot.user.host) {
2020-08-02 17:08:07 +10:00
var fullname = toot.user.username + "@" + toot.user.host
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var domain = localStorage.getItem("domain_" + acct_id)
var fullname = toot.user.username + "@" + domain
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (useremp) {
Object.keys(useremp).forEach(function (key10) {
2020-08-02 17:08:07 +10:00
var user = useremp[key10]
2019-05-08 01:48:59 +10:00
if (user == fullname) {
2020-08-02 17:08:07 +10:00
boostback = "emphasized"
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
})
2018-07-30 21:03:49 +10:00
}
}
}
2020-08-02 17:08:07 +10:00
var id = toot.id
2018-07-30 21:03:49 +10:00
if (mix == "home") {
var home = ""
2020-08-02 17:08:07 +10:00
var divider = '<div class="divider"></div>'
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var home = ""
var divider = '<div class="divider"></div>'
2019-05-08 01:48:59 +10:00
}
2018-07-30 21:03:49 +10:00
/*
if (toot.account.locked) {
var locked = ' <i class="fa fa-lock red-text"></i>';
} else {
var locked = "";
}
*/
if (!toot.app) {
2019-05-08 01:48:59 +10:00
if (toot.viaMobile) {
2020-08-02 17:08:07 +10:00
var via = '<span style="font-style: italic;">Mobile</span>'
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var via = ''
viashow = "via-hide"
2019-05-08 01:48:59 +10:00
}
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var via = escapeHTML(toot.app.name)
2019-05-08 01:48:59 +10:00
if (!toot.app.name) {
2020-08-02 17:08:07 +10:00
viashow = "via-hide"
2019-05-08 01:48:59 +10:00
}
2018-07-30 21:03:49 +10:00
//強調チェック
2019-06-22 00:17:56 +10:00
Object.keys(empCli).forEach(function (key6) {
2020-08-02 17:08:07 +10:00
var empCliList = empCli[key6]
2019-06-22 00:17:56 +10:00
if (empCliList == via) {
2020-08-02 17:08:07 +10:00
boostback = "emphasized"
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
})
2018-07-30 21:03:49 +10:00
//ミュートチェック
2019-06-22 00:17:56 +10:00
Object.keys(muteCli).forEach(function (key7) {
2020-08-02 17:08:07 +10:00
var muteCliList = muteCli[key7]
2019-06-22 00:17:56 +10:00
if (muteCliList == via) {
2020-08-02 17:08:07 +10:00
boostback = "hide"
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
})
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if ((toot.cw || toot.cw == "") && cw) {
2020-08-02 17:08:07 +10:00
var content = escapeHTML(toot.text)
var spoil = escapeHTMLtemp(toot.cw)
var spoiler = "cw cw_hide"
var api_spoil = "gray"
var spoiler_show = '<a href="#" onclick="cw_show(this)" class="nex parsed cw_btn">' + lang.lang_parse_cwshow + '</a><br>'
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var ct1 = nl2br(toot.text).split('<br />').length - 2
var ct2 = nl2br(toot.text).split('<br>').length - 2
if (ct1 > ct2) { var ct = ct1 } else { var ct = ct2 }
2018-12-09 05:46:01 +11:00
if ((sent < ct && $.mb_strlen($.strip_tagstemp(toot.text)) > 5) || ($.strip_tagstemp(toot.text).length > ltr && $.mb_strlen($.strip_tagstemp(toot.text)) > 5)) {
2019-05-08 01:48:59 +10:00
var content = '<span class="gray">' + lang.lang_parse_fulltext + '</span><br>' + escapeHTMLtemp(toot.text)
2020-04-07 14:02:20 +10:00
var spoil = '<span class="cw_long">' + $.mb_substr($.strip_tagstemp(
2019-05-08 01:48:59 +10:00
toot.text), 0, 100) +
2020-08-02 17:08:07 +10:00
'</span><span class="gray">' + lang.lang_parse_autofold + '</span>'
var spoiler = "cw cw_hide"
var spoiler_show = '<a href="#" onclick="cw_show(this)" class="nex parsed cw_btn">' + lang.lang_parse_more + '</a><br>'
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var content = escapeHTMLtemp(toot.text)
2019-05-08 01:48:59 +10:00
if (toot.cw) {
2020-08-02 17:08:07 +10:00
var spoil = escapeHTMLtemp(toot.cw)
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var spoil = ""
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
var spoiler = ""
var spoiler_show = ""
2018-07-30 21:03:49 +10:00
}
}
2020-08-02 17:08:07 +10:00
var analyze = ''
2018-12-09 05:46:01 +11:00
var urls = $.strip_tagstemp(content).replace(/\n/g, " ").match(
2018-08-17 03:21:40 +10:00
/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
2020-08-02 17:08:07 +10:00
)
2018-08-17 03:21:40 +10:00
if (urls) {
var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
2020-08-02 17:08:07 +10:00
',\'' + id + '\')" class="add-show pointer">' + lang.lang_parse_url + '</a><br>'
2018-08-17 03:21:40 +10:00
} else {
2020-08-02 17:08:07 +10:00
var analyze = ''
2018-08-17 03:21:40 +10:00
}
2020-08-02 17:08:07 +10:00
var viewer = "<br>"
var hasmedia = ""
var youtube = ""
2019-05-08 01:48:59 +10:00
if (toot.emojis) {
2020-08-02 17:08:07 +10:00
var emojick = toot.emojis[0]
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var emojick = false
2019-04-11 03:59:13 +10:00
}
2019-05-08 01:48:59 +10:00
//デフォ絵文字
if (content) {
//MFM
2019-05-08 01:48:59 +10:00
content = content.replace(/^"([^"]+)"$/gmi, '<blockquote>$1</blockquote>')
content = content.replace(/`(.+)`/gi, '<code>$1</code>')
content = content.replace(/(http(s)?:\/\/[\x21-\x7e]+)/gi, '<a href="$1" target="_blank">$1</a>')
content = content.replace(/\(\(\((.+)\)\)\)/gi, '<span class="shake">$1</span>')
content = content.replace(/&lt;motion&gt;(.+)&lt;\/motion&gt;/gi, '<span class="shake">$1</span>')
content = content.replace(/\*\*\*([^*]+)\*\*\*/gi, '<span class="shake" style="font-size:200%">$1</span>')
content = content.replace(/\*\*([^*]+)\*\*/gi, '<b>$1</b>')
content = content.replace(/^(.+)\s(検索|search)$/gmi, '<div class="input-field"><i class="material-icons prefix">search</i><input type="text" style="width:calc( 60% - 80px);" name="q" value="$1" id="srcbox_' + toot.id + '"><label for="src" data-trans="src" class="">検索</label><button class="btn waves-effect indigo" style="width:40%;" data-trans-i="src" onclick="goGoogle(\'' + toot.id + '\')">検索</button></div>')
2020-08-02 17:08:07 +10:00
content = content.replace(/\[(.+)\]\(<a href="(http(s)?:\/\/[\x21-\x7e]+)".+\)/gi, '<a href="$2" target="_blank">$1</a>')
2019-05-08 01:48:59 +10:00
content = content.replace(/&lt;center&gt;/gi, '<div class="center">')
content = content.replace(/&lt;\/center&gt;/gi, '</div>')
content = content.replace(/&lt;flip&gt;(.+)&lt;\/flip&gt;/gi, '<span class="fa fa-flip-horizontal">$1</span>')
content = content.replace(/&lt;small&gt;(.+)&lt;\/small&gt;/gi, '<small>$1</small>')
content = content.replace(/&lt;i&gt;(.+)&lt;\/i&gt;/gi, '<i>$1</i>')
content = content.replace(/&lt;spin&gt;(.+)&lt;\/spin&gt;/gi, '<span class="fa fa-spin">$1</span>')
content = content.replace(/\*\*(.+)\*\*/gi, '<b>$1</b>')
content = content.replace(/&lt;jump&gt;(.+)&lt;\/jump&gt;/gi, '<span class="jump">$1</jump>')
2020-08-02 17:08:07 +10:00
content = twemoji.parse(content)
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
content = ""
2019-05-08 01:48:59 +10:00
}
2019-04-11 03:59:13 +10:00
//絵文字があれば
if (emojick) {
2019-05-08 01:48:59 +10:00
Object.keys(toot.emojis).forEach(function (key5) {
2020-08-02 17:08:07 +10:00
var emoji = toot.emojis[key5]
var shortcode = emoji.name
2019-04-11 03:59:13 +10:00
var emoji_url = '<img draggable="false" src="' + emoji.url +
2020-08-02 17:08:07 +10:00
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">'
var regExp = new RegExp(":" + shortcode + ":", "g")
content = content.replace(regExp, emoji_url)
spoil = spoil.replace(regExp, emoji_url)
})
2019-04-11 03:59:13 +10:00
}
2019-05-08 01:48:59 +10:00
if (dis_name) {
2020-08-02 17:08:07 +10:00
dis_name = twemoji.parse(dis_name)
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
dis_name = ""
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (spoil) {
2020-08-02 17:08:07 +10:00
spoil = twemoji.parse(spoil)
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (noticetext) {
2020-08-02 17:08:07 +10:00
noticetext = twemoji.parse(noticetext)
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (notice) {
2020-08-02 17:08:07 +10:00
notice = twemoji.parse(notice)
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (toot.files) {
2020-08-02 17:08:07 +10:00
var mediack = toot.files[0]
var useparam = "files"
2019-05-08 01:48:59 +10:00
} else {
if (toot.media) {
2020-08-02 17:08:07 +10:00
var mediack = toot.media[0]
var useparam = "media"
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var mediack = false
2018-09-06 02:47:27 +10:00
}
2018-08-17 03:21:40 +10:00
}
2018-07-30 21:03:49 +10:00
//メディアがあれば
2020-08-02 17:08:07 +10:00
var media_ids = ""
2018-07-30 21:03:49 +10:00
if (mediack) {
2020-08-02 17:08:07 +10:00
hasmedia = "hasmedia"
var cwdt = 100 / toot[useparam].length
2019-05-08 01:48:59 +10:00
Object.keys(toot[useparam]).forEach(function (key2) {
2020-08-02 17:08:07 +10:00
var media = toot[useparam][key2]
var purl = media.url
media_ids = media_ids + media.id + ","
var url = media.url
2018-07-30 21:03:49 +10:00
if (media.isSensitive && nsfw) {
var sense = "sensitive"
} else {
var sense = ""
}
2019-05-08 01:48:59 +10:00
if (media.type.indexOf("video") !== -1) {
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
2019-05-08 01:48:59 +10:00
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
'" data-type="video" class="img-parsed"><video src="' +
purl + '" class="' + sense +
2020-08-02 17:08:07 +10:00
' toot-img pointer" style="max-width:100%;"></a></span>'
2019-06-23 02:20:17 +10:00
} else if (media.type.indexOf("audio") !== -1) {
2019-06-24 01:28:42 +10:00
viewer = viewer + '<audio src="' +
2019-06-23 02:20:17 +10:00
purl + '" class="' + sense +
2020-08-02 17:08:07 +10:00
' toot-img pointer" style="width:100%;" controls></span>'
2019-05-08 01:48:59 +10:00
} else {
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
2019-05-08 01:48:59 +10:00
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
'" data-type="image" class="img-parsed"><img src="' +
purl + '" class="' + sense +
2020-08-02 17:08:07 +10:00
' toot-img pointer" style="width:' + cwdt + '%; height:' + imh + 'px;" onerror="this.src=\'../../img/loading.svg\'"></a></span>'
}
2019-05-08 01:48:59 +10:00
2020-08-02 17:08:07 +10:00
})
media_ids = media_ids.slice(0, -1)
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
viewer = ""
hasmedia = "nomedia"
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var menck = toot.reply
var mentions = ""
2018-07-30 21:03:49 +10:00
//メンションであれば
if (menck) {
2018-08-23 03:29:39 +10:00
mentions = '<div style="float:right"><a onclick="udg(\'' + menck.user.id + '\',' +
2020-08-02 17:08:07 +10:00
acct_id + ')" class="pointer">@' + menck.user.username + '</a></div>'
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var tagck = toot.tags
var tags = ""
2018-07-30 21:03:49 +10:00
//タグであれば
if (tagck) {
2019-05-08 01:48:59 +10:00
Object.keys(toot.tags).forEach(function (key4) {
2020-08-02 17:08:07 +10:00
var tag = toot.tags[key4]
var tags = '<a onclick="tagShow(\'' + tag + '\', this)" class="pointer parsed">#' + tag + '</a><span class="hide" data-tag="' + tag + '" data-regTag="'+tag.toLowerCase()+'">#' + tag + ':<a onclick="tl(\'tag\',\'' + tag + '\',' + acct_id +
2019-05-08 01:48:59 +10:00
',\'add\')" class="pointer parsed" title="' + lang.lang_parse_tagTL.replace("{{tag}}", '#' + tag) + '">TL</a> <a onclick="brInsert(\'#' + tag + '\')" class="pointer parsed" title="' + lang.lang_parse_tagtoot.replace("{{tag}}", '#' + tag) + '">Toot</a> ' +
2020-08-02 17:08:07 +10:00
'<a onclick="tagPin(\'' + tag + '\')" class="pointer parsed" title="' + lang.lang_parse_tagpin.replace("{{tag}}", '#' + tag) + '">Pin</a></span> '
content = content.replace("#" + tag, tags)
})
2018-07-30 21:03:49 +10:00
//tags = '<div style="float:right">' + tags + '</div>';
}
//公開範囲を取得
2020-08-02 17:08:07 +10:00
var vis = ""
var visen = toot.visibility
2018-07-30 21:03:49 +10:00
if (visen == "public") {
var vis =
2020-08-02 17:08:07 +10:00
'<i class="text-darken-3 material-icons gray sml vis-data pointer" title="' + lang.lang_parse_public + '(' + lang.lang_parse_clickcopy + ')" data-vis="public" onclick="staCopy(\'' + id + '\')" style="font-size:1rem;">public</i>'
var can_rt = ""
2018-07-30 21:03:49 +10:00
} else if (visen == "home") {
var vis =
2020-08-02 17:08:07 +10:00
'<i class="text-darken-3 material-icons blue-text vis-data pointer" title="' + lang.lang_misskeyparse_home + '(' + lang.lang_parse_clickcopy + ')" data-vis="unlisted" onclick="staCopy(\'' + id + '\')" style="font-size:1rem;">lock_open</i>'
var can_rt = ""
2018-07-30 21:03:49 +10:00
} else if (visen == "followers") {
var vis =
2020-08-02 17:08:07 +10:00
'<i class="text-darken-3 material-icons blue-text vis-data pointer" title="' + lang.lang_misskeyparse_followers + '(' + lang.lang_parse_clickcopy + ')" data-vis="unlisted" onclick="staCopy(\'' + id + '\')" style="font-size:1rem;">people</i>'
var can_rt = ""
2018-07-30 21:03:49 +10:00
} else if (visen == "private") {
var vis =
2020-08-02 17:08:07 +10:00
'<i class="text-darken-3 material-icons orange-text vis-data pointer" title="' + lang.lang_parse_private + '(' + lang.lang_parse_clickcopy + ')" data-vis="private" onclick="staCopy(\'' + id + '\')" style="font-size:1rem;">lock</i>'
var can_rt = ""
2018-07-30 21:03:49 +10:00
} else if (visen == "specified") {
var vis =
2020-08-02 17:08:07 +10:00
'<i class="text-darken-3 material-icons red-text vis-data pointer" title="' + lang.lang_misskeyparse_specified + '(' + lang.lang_parse_clickcopy + ')" data-vis="direct" onclick="staCopy(\'' + id + '\')" style="font-size:1rem;">mail</i>'
var can_rt = "hide"
2018-07-30 21:03:49 +10:00
}
if (toot.user.username == localStorage.getItem("user_" + acct_id)) {
2020-08-02 17:08:07 +10:00
var if_mine = ""
var mine_via = "type-b"
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var if_mine = "hide"
var mine_via = ""
2018-07-30 21:03:49 +10:00
}
if (toot.myReaction) {
2020-08-02 17:08:07 +10:00
var if_fav = " yellow-text"
var fav_app = "faved"
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var if_fav = ""
var fav_app = ""
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
var if_rt = ""
var rt_app = ""
2018-07-30 21:03:49 +10:00
/*
if (toot.reblogged) {
2019-07-02 01:32:06 +10:00
var if_rt = "light-blue-text";
2018-07-30 21:03:49 +10:00
var rt_app = "rted";
} else {
var if_rt = "";
var rt_app = "";
}
*/
//アバター
2020-08-02 17:08:07 +10:00
var avatar = toot.user.avatarUrl
2018-07-30 21:03:49 +10:00
//ワードミュート
2019-06-22 00:17:56 +10:00
if (wordmuteList) {
Object.keys(wordmuteList).forEach(function (key8) {
2020-08-02 17:08:07 +10:00
var worde = wordmuteList[key8]
2019-05-08 01:48:59 +10:00
if (worde) {
if (worde.tag) {
2020-08-02 17:08:07 +10:00
var wordList = worde.tag
2019-05-08 01:48:59 +10:00
} else {
2019-06-22 00:17:56 +10:00
var wordList = worde
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g")
2019-05-08 01:48:59 +10:00
if ($.strip_tagstemp(content).match(regExp)) {
2020-08-02 17:08:07 +10:00
boostback = "hide by_filter"
2018-07-30 21:03:49 +10:00
}
}
2020-08-02 17:08:07 +10:00
})
2018-07-30 21:03:49 +10:00
}
//ワード強調
2019-06-22 00:17:56 +10:00
if (wordempList) {
Object.keys(wordempList).forEach(function (key9) {
2020-08-02 17:08:07 +10:00
var wordList = wordempList[key9]
2019-06-22 00:17:56 +10:00
if (wordList) {
2020-08-02 17:08:07 +10:00
var wordList = wordList.tag
var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g")
content = content.replace(regExp, '<span class="emp">' + wordList + "</span>")
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
})
}
2018-12-09 05:46:01 +11:00
//Ticker
2020-08-02 17:08:07 +10:00
var tickerdom = ""
2019-05-08 01:48:59 +10:00
if (ticker) {
2020-08-02 17:08:07 +10:00
var tickerdata = JSON.parse(localStorage.getItem("ticker"))
2019-05-08 01:48:59 +10:00
2020-08-02 17:08:07 +10:00
var thisdomain = toot.user.username.split("@")
2019-05-08 01:48:59 +10:00
if (thisdomain.length > 1) {
2020-08-02 17:08:07 +10:00
thisdomain = thisdomain[1]
2018-12-09 05:46:01 +11:00
}
2019-05-08 01:48:59 +10:00
for (var i = 0; i < tickerdata.length; i++) {
2020-08-02 17:08:07 +10:00
var value = tickerdata[i]
2019-05-08 01:48:59 +10:00
if (value.domain == thisdomain) {
2020-08-02 17:08:07 +10:00
var tickerdom = '<div style="background:linear-gradient(to left,transparent, ' + value.bg + ' 96%) !important; color:' + value.text + ';width:100%; height:0.9rem; font-size:0.8rem;"><img src="' + value.image + '" style="height:100%;"><span style="position:relative; top:-0.2rem;"> ' + escapeHTML(value.name) + '</span></div>'
break
2018-12-09 05:46:01 +11:00
}
2019-05-08 01:48:59 +10:00
}
2018-12-09 05:46:01 +11:00
}
//Poll
2020-08-02 17:08:07 +10:00
var poll = ""
2019-05-08 01:48:59 +10:00
if (toot.poll) {
2020-08-02 17:08:07 +10:00
var choices = toot.poll.choices
2019-05-08 01:48:59 +10:00
Object.keys(choices).forEach(function (keyc) {
2020-08-02 17:08:07 +10:00
var choice = choices[keyc]
2019-05-08 01:48:59 +10:00
if (choice.isVoted) {
2020-08-02 17:08:07 +10:00
var myvote = twemoji.parse("✅")
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var myvote = ""
}
2020-08-02 17:08:07 +10:00
poll = poll + '<div class="pointer vote" onclick="vote(\'' + acct_id + '\',\'' + toot.id + '\',' + choice.id + ')">' + escapeHTML(choice.text) + '(' + choice.votes + '' + myvote + ')</div>'
})
poll = '<div class="vote_' + toot.id + '">' + poll + '</div>'
}
2019-04-15 01:45:04 +10:00
//引用Renote
2019-05-08 01:48:59 +10:00
if (toot.renote) {
poll = poll + '<div class="quote-renote"><div class="renote-icon"><a onclick="udg(\'' + toot.renote.user.id +
'\',' + acct_id + ');" user="' + toot.renote.user.username + '" class="udg"><img src="' + toot.renote.user.avatarUrl + '"></a></div><div class="renote-user">' + escapeHTML(toot.renote.user.name) + '</div><div class="renote-text">' + escapeHTML(toot.renote.text) + '</div></div>'
}
if (localStorage.getItem("emojiReaction_" + acct_id) == "disabled") {
2020-08-02 17:08:07 +10:00
var freeReact = "hide"
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var freeReact = ""
2019-04-15 01:45:04 +10:00
}
2019-03-21 15:39:30 +11:00
//Reactions
2020-08-02 17:08:07 +10:00
var addReact = ""
2019-05-09 01:31:05 +10:00
if (toot.reactions) {
Object.keys(toot.reactions).forEach(function (keye) {
2020-08-02 17:08:07 +10:00
var thisReact = toot.reactions[keye]
if (keye == "like") { var defaultEmoji = true }
else if (keye == "love") { var defaultEmoji = true }
else if (keye == "laugh") { var defaultEmoji = true }
else if (keye == "hmm") { var defaultEmoji = true }
else if (keye == "surprise") { var defaultEmoji = true }
else if (keye == "congrats") { var defaultEmoji = true }
else if (keye == "angry") { var defaultEmoji = true }
else if (keye == "confused") { var defaultEmoji = true }
else if (keye == "star") { var defaultEmoji = true }
2019-05-08 01:48:59 +10:00
else {
2020-08-02 17:08:07 +10:00
var obj = JSON.parse(localStorage.getItem("emoji_" + acct_id))
2019-05-08 01:48:59 +10:00
if (obj) {
2020-08-02 17:08:07 +10:00
var num = obj.length
var ehtml = ""
2019-05-08 01:48:59 +10:00
for (i = 0; i < num; i++) {
2020-08-02 17:08:07 +10:00
var emoji = obj[i]
2019-05-08 01:48:59 +10:00
if (":" + emoji.shortcode + ":" == keye) {
if (emoji) {
addReact = addReact + '<span class="reaction"><a onclick="reaction(\'' + keye + '\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;"><img src="' + emoji.url + '" style="width:13px;"></a><span class="re-' + emoji.shortcode + 'ct">' + thisReact +
2020-08-02 17:08:07 +10:00
'</span></span>'
2019-05-08 01:48:59 +10:00
}
2019-04-11 02:52:01 +10:00
}
}
2019-05-08 01:48:59 +10:00
}
2019-04-11 02:52:01 +10:00
}
2020-08-02 17:08:07 +10:00
})
2019-05-09 01:31:05 +10:00
if (toot.reactions.like) {
2020-08-02 17:08:07 +10:00
var like = toot.reactions.like
var likehide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var like = 0
var likehide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.love) {
2020-08-02 17:08:07 +10:00
var love = toot.reactions.love
var lovehide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var love = 0
var lovehide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.laugh) {
2020-08-02 17:08:07 +10:00
var laugh = toot.reactions.laugh
var laughhide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var laugh = 0
var laughhide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.hmm) {
2020-08-02 17:08:07 +10:00
var hmm = toot.reactions.hmm
var hmmhide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var hmm = 0
var hmmhide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.surprise) {
2020-08-02 17:08:07 +10:00
var surprise = toot.reactions.surprise
var suphide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var suphide = "hide"
var surprise = 0
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.congrats) {
2020-08-02 17:08:07 +10:00
var congrats = toot.reactions.congrats
var conghide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var congrats = 0
var conghide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.angry) {
2020-08-02 17:08:07 +10:00
var angry = toot.reactions.angry
var anghide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var angry = 0
var anghide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.confused) {
2020-08-02 17:08:07 +10:00
var confhide = ""
var confused = toot.reactions.confused
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var confused = 0
var confhide = "hide"
2019-05-08 01:48:59 +10:00
}
2019-05-09 01:31:05 +10:00
if (toot.reactions.rip) {
2020-08-02 17:08:07 +10:00
var riphide = ""
var rip = toot.reactions.rip
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var rip = 0
var riphide = "hide"
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
var fullhide = ""
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var like = 0; var love = 0; var laugh = 0; var hmm = 0; var surprise = 0; var congrats = 0; var angry = 0; var confused = 0; var pudding = 0
2019-05-19 17:39:30 +10:00
var likehide = "hide"; var lovehide = "hide"; var laughhide = "hide"; var hmmhide = "hide"; var suphide = "hide"; var conghide = "hide"; var anghide = "hide"; var confhide = "hide"; var riphide = "hide"
2020-08-02 17:08:07 +10:00
var fullhide = "hide"
}
2019-05-19 17:39:30 +10:00
if (!addReact && likehide == "hide" && lovehide == "hide" && laughhide == "hide" && hmmhide == "hide" && suphide == "hide" && conghide == "hide" && anghide == "hide" && confhide == "hide" && riphide == "hide") {
2020-08-02 17:08:07 +10:00
var fullhide = "hide"
2019-05-08 01:48:59 +10:00
}
if (toot.myReaction) {
2020-08-02 17:08:07 +10:00
var reacted = toot.myReaction
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var reacted = ""
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
content = nl2br(content)
2019-05-08 01:48:59 +10:00
if (!content || content == "") {
2020-08-02 17:08:07 +10:00
content = '<span class="gray">This post has no content. It may be media-only, private or deleted.</span>'
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
var trans = ""
2019-05-08 01:48:59 +10:00
if (toot.user.emojis) {
2020-08-02 17:08:07 +10:00
var actemojick = toot.user.emojis[0]
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var actemojick = false
2019-04-11 03:59:13 +10:00
}
2020-11-28 07:57:11 +11:00
var rand = randomStr(8)
2018-07-30 21:03:49 +10:00
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
2019-05-08 01:48:59 +10:00
boostback + ' ' + fav_app + ' ' + rt_app + ' ' + hasmedia + '" toot-id="' + id + '" unique-id="' + uniqueid + '" data-medias="' + media_ids + ' " unixtime="' + date(obj[
2020-11-28 07:57:11 +11:00
key].created_at, 'unix') + '" ' + if_notf + ' onmouseover="mov(\'' + toot.id + '\',\'' + tlid + '\',\'mv\', \''+rand+'\')" onclick="mov(\'' + toot.id + '\',\'' + tlid + '\',\'cl\', \''+rand+'\')" onmouseout="resetmv(\'mv\')" reacted="' + reacted + '">' +
2018-07-30 21:03:49 +10:00
'<div class="area-notice"><span class="gray sharesta">' + notice + home +
'</span></div>' +
'<div class="area-icon"><a onclick="udg(\'' + toot.user.id +
'\',' + acct_id + ');" user="' + toot.user.username + '" class="udg">' +
'<img src="' + avatar +
2020-05-23 14:54:51 +10:00
'" width="40" class="prof-img" user="' + toot.user.username +
2019-08-21 01:36:47 +10:00
'" onerror="this.src=\'../../img/loading.svg\'"></a></div>' +
2018-07-30 21:03:49 +10:00
'<div class="area-display_name"><div class="flex-name"><span class="user">' +
dis_name +
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' +
toot.user.username + '</span></div>' +
2019-05-08 01:48:59 +10:00
'<div class="flex-time"><span class="cbadge cbadge-hover pointer waves-effect" onclick="tootUriCopy(\'https://' + domain + "/notes/" +
2018-08-24 01:15:57 +10:00
toot.id + '\');" title="' + date(toot.createdAt, 'absolute') +
2019-05-08 01:48:59 +10:00
'(' + lang.lang_parse_clickcopyurl + ')"><i class="far fa-clock"></i>' +
2018-07-30 21:03:49 +10:00
date(toot.createdAt, datetype) + '</span>' +
'</div></div>' +
2019-05-08 01:48:59 +10:00
'<div class="area-toot">' + tickerdom + '<span class="toot ' + spoiler + '">' + content +
2018-07-30 21:03:49 +10:00
'</span><span class="' +
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
'</span>' +
'' + viewer + '' +
2019-05-08 01:48:59 +10:00
'</div><div class="area-additional"><span class="additional">' + analyze +
'<div class="reactions ' + fullhide + '" style="height: 25px;"><span class="' + likehide + ' reaction re-like"><a onclick="reaction(\'like\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat" style="padding:0;margin-left:3px;">' + twemoji.parse("👍") + '</a><span class="re-likect">' + like +
'</span></span><span class="' + lovehide + ' reaction re-love"><a onclick="reaction(\'love\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("💓") + '</a><span class="re-lovect">' + love +
'</span></span><span class="' + laughhide + ' reaction re-laugh"><a onclick="reaction(\'laugh\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("😁") + '</a><span class="re-laughct">' + laugh +
'</span></span><span class="' + hmmhide + ' reaction re-hmm"><a onclick="reaction(\'hmm\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("🤔") + '</a><span class="re-hmmct">' + hmm +
'</span></span><span class="' + suphide + ' reaction re-surprise"><a onclick="reaction(\'surprise\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("😮") + '</a><span class="re-surprisect">' + surprise +
'</span></span><span class="' + conghide + ' reaction re-congrats"><a onclick="reaction(\'congrats\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("🎉") + '</a><span class="re-congratsct">' + congrats +
'</span></span><span class="' + anghide + ' reaction re-angry"><a onclick="reaction(\'angry\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("💢") + '</a><span class="re-angryct">' + angry +
'</span></span><span class="' + confhide + ' reaction re-confused"><a onclick="reaction(\'confused\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("😥") + '</a><span class="re-confusedct">' + confused +
2019-05-09 01:31:05 +10:00
'</span></span><span class="' + riphide + ' reaction re-confused"><a onclick="reaction(\'confused\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("😇") + '</a><span class="re-confusedct">' + rip +
2019-05-08 01:48:59 +10:00
'</span></span>' + addReact +
'<i class="material-icons pointer hide freeReact ' + freeReact + '" style="font-size:1.0rem; padding-left:5px;position: relative;top: 3px;" onclick="reactioncustom(\'' + acct_id + '\',\'' + id + '\')">add_box</i></div>'
+ poll + mentions + tags + '</div>' +
'<div class="area-vis"></div>' +
'<div class="area-actions ' + mouseover + '">' +
'<div class="action">' + vis + '</div>' +
'<div class="action ' + antinoauth + '"><a onclick="detEx(\'https://misskey.xyz/notes/' + toot.id + '\',\'main\')" class="waves-effect waves-dark details" style="padding:0">' + lang.lang_parse_det + '</a></div>' +
'<div class="action ' + disp["re"] + ' ' + noauth + '"><a onclick="misskeyreply(\'' + toot.id +
2018-07-30 21:03:49 +10:00
'\',\'' + acct_id + '\',' +
2019-05-08 01:48:59 +10:00
acct_id + ',\'' + visen +
2019-07-12 01:53:55 +10:00
'\')" class="waves-effect waves-dark btn-flat rep-btn" style="padding:0" title="' + lang.lang_parse_replyto + '"><i class="fas fa-share"></i></a></div>' +
2019-05-08 01:48:59 +10:00
'<div class="action ' + can_rt + ' ' + disp["rt"] + ' ' + noauth + '"><a onclick="renote(\'' + toot.id + '\',' + acct_id +
2018-07-30 21:03:49 +10:00
',\'' + tlid +
2019-07-12 01:53:55 +10:00
'\')" class="waves-effect waves-dark btn-flat bt-btn" style="padding:0" title="' + lang.lang_misskeyparse_renote + '"><i class="text-darken-3 fas fa-retweet ' +
2018-07-30 21:03:49 +10:00
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct"></span></a></div>' +
2019-05-08 01:48:59 +10:00
'<div class="action ' + can_rt + ' ' + disp["qt"] + ' ' + noauth + '"><a onclick="renoteqt(\'' + toot.id + '\',' + acct_id +
',\'misskey.xyz\',\'misskey.xyz\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_misskeyparse_renoteqt + '"><i class="text-darken-3 fas fa-quote-right"></i></a></div>' +
'<div class="action ' + disp["fav"] + ' ' + noauth + '"><a onclick="reactiontoggle(\'' + toot.id + '\',' + acct_id +
2018-07-30 21:03:49 +10:00
',\'' + tlid +
2019-05-08 01:48:59 +10:00
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_misskeyparse_reaction + '"><i class="fas text-darken-3 fa-plus' +
2018-07-30 21:03:49 +10:00
if_fav + ' fav_' + toot.id + '"></i></div>' +
2019-05-08 01:48:59 +10:00
'<div class="' + if_mine + ' action ' + disp["del"] + ' ' + noauth + '"><a onclick="del(\'' + toot.id + '\',' +
2018-07-30 21:03:49 +10:00
acct_id +
2019-05-08 01:48:59 +10:00
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_del + '"><i class="fas fa-trash"></i></a></div>' +
'<div class="' + if_mine + ' action pin ' + disp["pin"] + ' ' + noauth + '"><a onclick="pin(\'' + toot.id + '\',' +
2018-07-30 21:03:49 +10:00
acct_id +
2019-05-08 01:48:59 +10:00
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_pin + '"><i class="fas fa-map-pin pin_' + toot.id + '"></i></a></div>'
+ '<div class="' + if_mine + ' action ' + disp["red"] + ' ' + noauth + '"><a onclick="redraft(\'' + toot.id + '\',' +
2018-07-30 21:03:49 +10:00
acct_id +
2019-05-08 01:48:59 +10:00
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_redraft + '"><i class="material-icons">redo</i></a></div>' + trans +
'<span class="cbadge viabadge waves-effect ' + viashow + ' ' + mine_via + '" onclick="client(\'' + $.strip_tagstemp(via) + '\')" title="via ' + $.strip_tagstemp(via) + '">via ' +
via +
'</span>' +
'</div><div class="area-side ' + mouseover + '"><div class="action ' + if_mine + ' ' + noauth + '"><a onclick="toggleAction(\'' + toot.id + '\',\'' + tlid + '\',\'' + acct_id + '\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 material-icons act-icon">expand_more</i></a></div>' +
'<div class="action ' + noauth + '"><a onclick="details(\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
2018-07-30 21:03:49 +10:00
'</div></div>' +
2020-08-02 17:08:07 +10:00
'</div></div>'
})
return templete
2018-07-30 21:03:49 +10:00
}
//オブジェクトパーサー(ユーザーデータ)
function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
2019-05-19 17:39:30 +10:00
console.log(["Parse them ", obj])
2019-05-08 01:48:59 +10:00
if (popup > 0 || popup == -1) {
} else {
2019-05-19 17:39:30 +10:00
if (obj.users) {
2020-08-02 17:08:07 +10:00
var obj = obj.users
2019-05-08 01:48:59 +10:00
}
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var templete = ''
var datetype = localStorage.getItem("datetype")
2019-05-08 01:48:59 +10:00
Object.keys(obj).forEach(function (key) {
2020-08-02 17:08:07 +10:00
var toot = obj[key]
2019-05-19 17:39:30 +10:00
if (toot.followee) {
toot = toot.followee
} else if (toot.follower) {
toot = toot.follower
2019-05-09 01:31:05 +10:00
}
2020-08-02 17:08:07 +10:00
var locked = ""
2018-07-30 21:03:49 +10:00
if (auth) {
var auth = '<i class="material-icons gray pointer" onclick="misskeyRequest(\'' +
2020-08-02 17:08:07 +10:00
toot.id + '\',\'accept\',' + acct_id + ')">person_add</i>'
2018-07-30 21:03:49 +10:00
} else {
2020-08-02 17:08:07 +10:00
var auth = ""
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var ftxt = lang.lang_parse_followed
2019-05-08 01:48:59 +10:00
if (popup > 0 || popup == -1) {
var notftext = '<span class="cbadge" title="' + date(toot.createdAt,
2019-05-08 01:48:59 +10:00
'absolute') + '(' + lang.lang_parse_notftime + ')"><i class="far fa-clock"></i>' + date(toot.createdAt,
datetype) +
2020-08-02 17:08:07 +10:00
'</span>' + ftxt + '<br>'
var toot = toot.user
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var notftext = ""
2018-07-30 21:03:49 +10:00
}
2020-08-02 17:08:07 +10:00
var memory = localStorage.getItem("notice-mem")
2019-05-08 01:48:59 +10:00
if (popup >= 0 && obj.length < 5 && notftext != memory) {
2019-06-07 02:11:04 +10:00
M.toast({ html: escapeHTMLtemp(toot.name) + ":" + ftxt, displayLength: popup * 1000 })
2020-08-02 17:08:07 +10:00
$(".notf-icon_" + tlid).addClass("red-text")
localStorage.setItem("notice-mem", notftext)
notftext = ""
var native = localStorage.getItem("nativenotf")
2019-05-08 01:48:59 +10:00
if (!native) {
2020-08-02 17:08:07 +10:00
native = "yes"
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
if (native == "yes") {
2020-08-02 17:08:07 +10:00
var os = localStorage.getItem("platform")
2019-05-08 01:48:59 +10:00
var options = {
body: toot.display_name + "(" + toot.acct + ")" + ftxt,
icon: toot.avatar
2020-08-02 17:08:07 +10:00
}
var domain = localStorage.getItem("domain_" + acct_id)
var n = new Notification('TheDesk:' + domain, options)
2018-07-30 21:03:49 +10:00
}
2019-05-08 01:48:59 +10:00
}
if (toot.name) {
2020-08-02 17:08:07 +10:00
var dis_name = escapeHTMLtemp(toot.name)
dis_name = twemoji.parse(dis_name)
2019-05-08 01:48:59 +10:00
} else {
2020-08-02 17:08:07 +10:00
var dis_name = toot.username
2019-05-08 01:48:59 +10:00
}
2019-05-19 17:39:30 +10:00
if (toot.followersCount) {
var ferct = toot.followersCount
} else {
var ferct = "unknown"
2019-05-09 01:31:05 +10:00
}
2019-05-19 17:39:30 +10:00
if (toot.followingCount) {
var fingct = toot.followingCount
} else {
var fingct = "unknown"
2019-05-09 01:31:05 +10:00
}
2018-07-30 21:03:49 +10:00
templete = templete +
'<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' +
notftext +
'</div><div class="area-icon"><a onclick="udg(\'' + toot.id + '\',' +
acct_id + ');" user="' + toot.username + '" class="udg">' +
'<img src="' + toot.avatarUrl + '" width="40" class="prof-img" user="' + toot
2019-05-08 01:48:59 +10:00
.username + '"></a></div>' +
2018-07-30 21:03:49 +10:00
'<div class="area-display_name"><div class="flex-name"><span class="user">' +
dis_name + '</span>' +
'<span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
2019-05-08 01:48:59 +10:00
toot.username + auth + '</span>' +
2018-07-30 21:03:49 +10:00
'</div>' +
'</div>' +
'<div style="justify-content:space-around" class="area-toot"> <div class="cbadge" style="width:100px;">Follows:' +
2019-05-09 01:31:05 +10:00
fingct +
'</div><div class="cbadge" style="width:100px;">Followers:' + ferct +
2018-07-30 21:03:49 +10:00
'</div>' +
'</div>' +
'</div>' +
2020-08-02 17:08:07 +10:00
'</div>'
2018-07-30 21:03:49 +10:00
2020-08-02 17:08:07 +10:00
})
return templete
}
2019-05-08 01:48:59 +10:00
function goGoogle(id) {
2020-08-02 17:08:07 +10:00
var val = $("#srcbox_" + id).val()
var url = "https://google.com/search?q=" + val
postMessage(["openUrl", url], "*")
2019-05-08 01:48:59 +10:00
}
2019-05-19 17:39:30 +10:00
var misskeyws = []
var misskeywsstate = []
2019-07-09 01:27:18 +10:00
function connectMisskey(acct_id, re) {
2020-08-02 17:08:07 +10:00
var domain = localStorage.getItem("domain_" + acct_id)
var at = localStorage.getItem("acct_" + acct_id + "_at")
2019-05-08 01:48:59 +10:00
var start = "wss://" + domain +
2020-08-02 17:08:07 +10:00
"/streaming?i=" + at
var wsid = misskeyws.length
localStorage.setItem("misskey_wss_" + acct_id, wsid)
misskeyws[wsid] = new WebSocket(start)
2019-05-08 01:48:59 +10:00
misskeyws[wsid].onopen = function (mess) {
2019-05-19 17:39:30 +10:00
console.table({ "tlid": tlid, "type": "Connect Streaming API", "domain": domain, "message": [mess] })
misskeywsstate[wsid] = true
2019-05-08 01:48:59 +10:00
//$("#notice_icon_" + tlid).removeClass("red-text");
2019-05-19 17:39:30 +10:00
var send = '{"type":"connect","body":{"channel":"main","id":"notf:' + acct_id + '"}}'
2019-05-08 01:48:59 +10:00
misskeyws[wsid].send(send)
}
misskeyws[wsid].onmessage = function (mess) {
2020-08-02 17:08:07 +10:00
console.log([domain + ":Receive Streaming API:", data])
2019-05-19 17:39:30 +10:00
var data = JSON.parse(mess.data)
var obj = data.body.body
2020-08-02 17:08:07 +10:00
var mute = []
2019-05-19 17:39:30 +10:00
if (data.body.id.indexOf("notf:") !== -1) {
2020-08-02 17:08:07 +10:00
var obj = JSON.parse(mess.data).body
var popup = localStorage.getItem("popup")
2019-05-08 01:48:59 +10:00
if (!popup) {
2020-08-02 17:08:07 +10:00
popup = 0
2019-05-08 01:48:59 +10:00
}
2019-05-19 17:39:30 +10:00
if (JSON.parse(mess.data).body.type != "follow") {
2020-08-02 17:08:07 +10:00
templete = misskeyParse([obj.body], 'notf', acct_id, 'notf', popup)
2019-05-19 17:39:30 +10:00
} else {
2020-08-02 17:08:07 +10:00
templete = misskeyUserparse([obj.body], 'notf', acct_id, 'notf', popup)
2019-05-08 01:48:59 +10:00
}
2019-05-19 17:39:30 +10:00
if (JSON.parse(mess.data).body.type == "reaction") {
2019-05-19 16:17:05 +10:00
console.log("reaction refresh")
2019-05-19 17:39:30 +10:00
reactRefresh(acct_id, obj.body.note.id)
2019-05-08 01:48:59 +10:00
}
2019-05-19 17:39:30 +10:00
if (!$("div[data-notfIndv=" + acct_id + "_" + obj.body.id + "]").length) {
2020-08-02 17:08:07 +10:00
$("div[data-notf=" + acct_id + "]").prepend(templete)
$("div[data-const=notf_" + acct_id + "]").prepend(templete)
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
jQuery("time.timeago").timeago()
2019-05-19 17:39:30 +10:00
} else if (data.body.type == "note") {
var tlid = data.body.id * 1
2020-08-02 17:08:07 +10:00
var multi = localStorage.getItem("column")
var col = JSON.parse(multi)[tlid]
2019-05-19 17:39:30 +10:00
if (localStorage.getItem("voice_" + tlid)) {
2020-08-02 17:08:07 +10:00
var voice = true
2019-05-19 17:39:30 +10:00
} else {
2020-08-02 17:08:07 +10:00
var voice = false
2019-05-19 17:39:30 +10:00
}
if (voice) {
say(obj.text)
}
2020-08-02 17:08:07 +10:00
var templete = misskeyParse([obj], col.type, acct_id, tlid, "", mute)
2019-05-19 17:39:30 +10:00
misskeyws[wsid].send(JSON.stringify({
type: 'sn',
body: {
id: obj.id
2019-05-11 02:31:15 +10:00
}
2019-05-19 17:39:30 +10:00
}))
2020-08-02 17:08:07 +10:00
var pool = localStorage.getItem("pool_" + tlid)
2019-05-19 17:39:30 +10:00
if (pool) {
2020-08-02 17:08:07 +10:00
pool = templete + pool
2019-05-19 17:39:30 +10:00
} else {
pool = templete
2019-05-08 01:48:59 +10:00
}
2020-08-02 17:08:07 +10:00
localStorage.setItem("pool_" + tlid, pool)
scrollck()
jQuery("time.timeago").timeago()
2019-05-19 17:39:30 +10:00
} else if (data.type == "noteUpdated") {
if (data.body.type == "reacted") {
reactRefresh(acct_id, data.body.id)
} else if (data.body.type == "deleted") {
2020-08-02 17:08:07 +10:00
$("#pub_" + data.body.id).hide()
$("#pub_" + data.body.id).remove()
2019-05-19 17:39:30 +10:00
}
}
2019-05-08 01:48:59 +10:00
}
misskeyws[wsid].onerror = function (error) {
2020-08-02 17:08:07 +10:00
console.error("Error closing " + tlid)
console.error(error)
2019-05-19 17:39:30 +10:00
misskeywsstate[wsid] = false
2019-07-09 01:27:18 +10:00
if(!re){
connectMisskey(acct_id, true)
}
2020-08-02 17:08:07 +10:00
return false
}
2019-05-08 01:48:59 +10:00
misskeyws[wsid].onclose = function () {
2020-08-02 17:08:07 +10:00
console.warn("Closing " + tlid)
2019-05-19 17:39:30 +10:00
misskeywsstate[wsid] = false
2019-07-09 01:27:18 +10:00
if(!re){
connectMisskey(acct_id, true)
}
2020-08-02 17:08:07 +10:00
return false
}
2019-05-08 01:48:59 +10:00
2018-07-30 21:03:49 +10:00
}