host in this server
This commit is contained in:
parent
e34f22fbc5
commit
fcd8bdce4b
|
@ -82,8 +82,11 @@ namespace MisskeyAPI {
|
|||
|
||||
export const userDetail = (u: Entity.UserDetail, host: string): MegalodonEntity.Account => {
|
||||
let acct = u.username
|
||||
if (host || u.host) {
|
||||
acct = `${u.username}@${host || u.host}`
|
||||
host = host.replace('https://', '')
|
||||
let acctUrl = `https://${host || u.host || 'example.com'}/@${u.username}`
|
||||
if (u.host) {
|
||||
acct = `${u.username}@${u.host}`
|
||||
acctUrl = `https://${u.host}/@${u.username}`
|
||||
}
|
||||
return {
|
||||
id: u.id,
|
||||
|
@ -104,7 +107,7 @@ namespace MisskeyAPI {
|
|||
emojis: u.emojis.map(e => emoji(e)),
|
||||
moved: null,
|
||||
fields: [],
|
||||
bot: u.isBot
|
||||
bot: u.isBot,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,6 +218,7 @@ namespace MisskeyAPI {
|
|||
}
|
||||
|
||||
export const note = (n: Entity.Note, host: string): MegalodonEntity.Status => {
|
||||
host = host.replace('https://', '')
|
||||
return {
|
||||
id: n.id,
|
||||
uri: n.uri ? n.uri : `https://${host}/notes/${n.id}`,
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
"noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
"noUnusedLocals": false, /* Report errors on unused locals. */
|
||||
"noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
|
Loading…
Reference in a new issue