@@ -930,125 +930,127 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} else {
var notf = false ;
}
if ( toot . locked ) {
var locked = ' <i class="fas fa-lock red-text"></i>' ;
} else {
var locked = "" ;
}
if ( auth == "request" ) {
var authhtml = '<i class="material-icons gray pointer" onclick="request(\'' +
toot . id + '\',\'authorize\',' + acct _id + ')" title="Accept">person_add</i> <i class="material-icons gray pointer" onclick="request(\'' +
toot . id + '\',\'reject\',' + acct _id + ')" title="Reject">person_add_disabled</i>' ;
} else {
var authhtml = "" ;
}
var ftxt = lang . lang _parse _followed ;
if ( ! locale && localStorage . getItem ( "followlocale_" + acct _id ) ) {
ftxt = localStorage . getItem ( "followlocale_" + acct _id ) ;
}
if ( popup > 0 || popup == - 1 || notf ) {
var notftext = ftxt + '<br>' ;
} else {
var notftext = "" ;
}
var memory = localStorage . getItem ( "notice-mem" ) ;
if ( popup >= 0 && obj . length < 5 && notftext != memory ) {
M . toast ( { html : escapeHTML ( toot . display _name ) + ":" + ftxt , displayLength : popup * 1000 } )
$ ( ".notf-icon_" + tlid ) . addClass ( "red-text" ) ;
localStorage . setItem ( "notice-mem" , notftext ) ;
notftext = "" ;
var native = localStorage . getItem ( "nativenotf" ) ;
if ( ! native ) {
native = "yes" ;
//Instance Actorって…
if ( toot . username . indexOf ( "." ) < 0 ) {
if ( toot . locked ) {
var locked = ' <i class="fas fa-lock red-text"></i>' ;
} else {
var locked = "" ;
}
if ( native == "y es" ) {
var os = localStorage . getItem ( "platform" ) ;
var options = {
body : toot . display _name + "(" + toot . acct + ")" + ftxt ,
icon : toot . avatar
} ;
var domain = localStorage . getItem ( "domain_" + acct _id ) ;
if ( os == "darwin" ) {
var n = new Notification ( 'TheDesk:' + domain , options ) ;
} else {
var nativeNotfOpt = [
'TheDesk:' + domain ,
toot . display _name + "(" + toot . acct + ")" + ftxt ,
toot . avatar ,
"userdata " ,
acct _id ,
toot . id
]
postMessage ( [ "nativeNotf" , nativeNotfOpt ] , "*" )
if ( auth == "requ est " ) {
var authhtml = '<i class="material-icons gray pointer" onclick="request(\'' +
toot . id + '\',\'authorize\',' + acct _id + ')" title="Accept">person_add</i> <i class="material-icons gray pointer" onclick="request(\'' +
toot . id + '\',\'reject\',' + acct _id + ')" title="Reject">person_add_disabled</i>' ;
} else {
var authhtml = "" ;
}
var ftxt = lang . lang _parse _followed ;
if ( ! locale && localStorage . getItem ( "followlocale_" + acct _id ) ) {
ftxt = localStorage . getItem ( "followlocale_" + acct _id ) ;
}
if ( popup > 0 || popup == - 1 || notf ) {
var notftext = ftxt + '<br>' ;
} else {
var notftext = " ";
}
var memory = localStorage . getItem ( "notice-mem" ) ;
if ( popup >= 0 && obj . length < 5 && notftext != memory ) {
M . toast ( { html : escapeHTML ( toot . display _name ) + ":" + ftxt , displayLength : popup * 1000 } )
$ ( ".notf-icon_" + tlid ) . addClass ( "red-text" ) ;
localStorage . setItem ( "notice-mem" , notftext ) ;
notftext = "" ;
var native = localStorage . getItem ( "nativenotf" ) ;
if ( ! native ) {
native = "yes" ;
}
if ( native == "yes" ) {
var os = localStorage . getItem ( "platform" ) ;
var options = {
body : toot . display _name + "(" + toot . acct + ")" + ftxt ,
icon : toot . avatar
} ;
var domain = localStorage . getItem ( "domain_" + acct _id ) ;
if ( os == "darwin" ) {
var n = new Notification ( 'TheDesk:' + domain , options ) ;
} else {
var nativeNotfOpt = [
'TheDesk:' + domain ,
toot . display _name + "(" + toot . acct + ")" + ftxt ,
toot . avatar ,
"userdata" ,
acct _id ,
toot . id
]
postMessage ( [ "nativeNotf" , nativeNotfOpt ] , "*" )
}
}
}
}
if ( toot . display _name ) {
var dis _name = escapeHTML ( toot . display _name ) ;
} else {
var dis _name = toot . username ;
}
//ネイティブ通知
if ( toot . display _name ) {
var dis _name = escapeHTML ( toot . display _name ) ;
} else {
var dis _name = toot . username ;
}
//ネイティブ通知
if ( toot . emojis ) {
var actemojick = toot . emojis [ 0 ] ;
} else {
var actemojick = false ;
if ( toot . emojis ) {
var actemojick = toot . emojis [ 0 ] ;
} else {
var actemojick = false ;
}
//絵文字があれば
if ( actemojick ) {
Object . keys ( toot . emojis ) . forEach ( function ( key5 ) {
var emoji = toot . emojis [ key5 ] ;
var shortcode = emoji . shortcode ;
var emoji _url = '<img draggable="false" src="' + emoji . url +
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">' ;
var regExp = new RegExp ( ":" + shortcode + ":" , "g" ) ;
dis _name = dis _name . replace ( regExp , emoji _url ) ;
} ) ;
}
if ( dis _name ) {
dis _name = twemoji . parse ( dis _name ) ;
}
if ( toot . avatar ) {
var avatar = toot . avatar ;
} else {
var avatar = "../../img/missing.svg" ;
}
if ( tlid == "dir" && acct _id == "noauth" ) {
var udg = '<a onclick="udgEx(\'' + toot . url + '\',\'main\');" user="' + toot . acct + '" class="udg">'
} else {
var udg = '<a onclick="udg(\'' + toot . id + '\',' +
acct _id + ');" user="' + toot . acct + '" class="udg">'
}
var latest = date ( toot . last _status _at , "relative" ) ;
if ( toot . last _status _at ) {
var latesthtml = '<div class="cbadge" style="width:100px;">Last: ' + latest +
'</div>'
} else {
var latesthtml = ""
}
templete = templete +
'<div class="cvo" style="padding-top:5px;" user-id="' + toot . id + '"><div class="area-notice">' +
notftext +
'</div><div class="area-icon">' + udg +
'<img draggable="false" src="' + avatar + '" width="40" class="prof-img" user="' + toot
. acct + '" onerror="this.src=\'../../img/loading.svg\'"></a></div>' +
'<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;"> @' +
toot . acct + locked + '</span>' +
'</div>' +
'</div>' +
'<div class="area-toot acct-note">' + 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;">' + lang . lang _status _follow + ':' +
toot . following _count +
'</div><div class="cbadge" style="width:100px;">' + lang . lang _status _followers + ':' + toot . followers _count +
'</div>' + latesthtml + authhtml +
'</div>' +
'</div>' ;
}
//絵文字があれば
if ( actemojick ) {
Object . keys ( toot . emojis ) . forEach ( function ( key5 ) {
var emoji = toot . emojis [ key5 ] ;
var shortcode = emoji . shortcode ;
var emoji _url = '<img draggable="false" src="' + emoji . url +
'" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">' ;
var regExp = new RegExp ( ":" + shortcode + ":" , "g" ) ;
dis _name = dis _name . replace ( regExp , emoji _url ) ;
} ) ;
}
if ( dis _name ) {
dis _name = twemoji . parse ( dis _name ) ;
}
if ( toot . avatar ) {
var avatar = toot . avatar ;
} else {
var avatar = "../../img/missing.svg" ;
}
if ( tlid == "dir" && acct _id == "noauth" ) {
var udg = '<a onclick="udgEx(\'' + toot . url + '\',\'main\');" user="' + toot . acct + '" class="udg">'
} else {
var udg = '<a onclick="udg(\'' + toot . id + '\',' +
acct _id + ');" user="' + toot . acct + '" class="udg">'
}
var latest = date ( toot . last _status _at , "relative" ) ;
if ( toot . last _status _at ) {
var latesthtml = '<div class="cbadge" style="width:100px;">Last: ' + latest +
'</div>'
} else {
var latesthtml = ""
}
templete = templete +
'<div class="cvo" style="padding-top:5px;" user-id="' + toot . id + '"><div class="area-notice">' +
notftext +
'</div><div class="area-icon">' + udg +
'<img draggable="false" src="' + avatar + '" width="40" class="prof-img" user="' + toot
. acct + '" onerror="this.src=\'../../img/loading.svg\'"></a></div>' +
'<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;"> @' +
toot . acct + locked + '</span>' +
'</div>' +
'</div>' +
'<div class="area-toot acct-note">' + 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;">' + lang . lang _status _follow + ':' +
toot . following _count +
'</div><div class="cbadge" style="width:100px;">' + lang . lang _status _followers + ':' + toot . followers _count +
'</div>' + latesthtml + authhtml +
'</div>' +
'</div>' ;
}
} ) ;
return templete ;
}