Merge branch 'develop' into fix-msg-room

This commit is contained in:
tamaina 2022-02-03 03:37:17 +09:00
commit fa809bb50c
19 changed files with 41 additions and 58 deletions

View File

@ -46,7 +46,7 @@
"@types/fluent-ffmpeg": "2.1.20", "@types/fluent-ffmpeg": "2.1.20",
"@typescript-eslint/parser": "5.10.0", "@typescript-eslint/parser": "5.10.0",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cypress": "9.3.1", "cypress": "9.4.1",
"start-server-and-test": "1.14.0", "start-server-and-test": "1.14.0",
"typescript": "4.5.5" "typescript": "4.5.5"
} }

View File

@ -1,3 +1,3 @@
export function isDuplicateKeyValueError(e: Error): boolean { export function isDuplicateKeyValueError(e: unknown | Error): boolean {
return e.message.startsWith('duplicate key value'); return (e as any).message && (e as Error).message.startsWith('duplicate key value');
} }

View File

@ -90,7 +90,7 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac
// API invoking // API invoking
const before = performance.now(); const before = performance.now();
return await ep.exec(data, user, token, ctx!.file).catch((e: Error) => { return await ep.exec(data, user, token, ctx?.file).catch((e: Error) => {
if (e instanceof ApiError) { if (e instanceof ApiError) {
throw e; throw e;
} else { } else {

View File

@ -105,7 +105,10 @@ export interface NoteStreamTypes {
}; };
reacted: { reacted: {
reaction: string; reaction: string;
emoji?: Emoji; emoji?: {
name: string;
url: string;
} | null;
userId: User['id']; userId: User['id'];
}; };
unreacted: { unreacted: {

View File

@ -21,6 +21,7 @@ html
meta(name='referrer' content='origin') meta(name='referrer' content='origin')
meta(name='theme-color' content='#86b300') meta(name='theme-color' content='#86b300')
meta(name='theme-color-orig' content='#86b300') meta(name='theme-color-orig' content='#86b300')
meta(property='twitter:card' content='summary')
meta(property='og:site_name' content= instanceName || 'Misskey') meta(property='og:site_name' content= instanceName || 'Misskey')
meta(name='viewport' content='width=device-width, initial-scale=1') meta(name='viewport' content='width=device-width, initial-scale=1')
link(rel='icon' href= icon || '/favicon.ico') link(rel='icon' href= icon || '/favicon.ico')
@ -42,7 +43,9 @@ html
block meta block meta
block og block og
meta(property='og:image' content=img) meta(property='og:title' content= title || 'Misskey')
meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
meta(property='og:image' content= img)
style style
include ../style.css include ../style.css

View File

@ -16,6 +16,3 @@ block og
meta(property='og:description' content= channel.description) meta(property='og:description' content= channel.description)
meta(property='og:url' content= url) meta(property='og:url' content= url)
meta(property='og:image' content= channel.bannerUrl) meta(property='og:image' content= channel.bannerUrl)
block meta
meta(name='twitter:card' content='summary')

View File

@ -26,8 +26,6 @@ block meta
meta(name='misskey:user-id' content=user.id) meta(name='misskey:user-id' content=user.id)
meta(name='misskey:clip-id' content=clip.id) meta(name='misskey:clip-id' content=clip.id)
meta(name='twitter:card' content='summary')
// todo // todo
if user.twitter if user.twitter
meta(name='twitter:creator' content=`@${user.twitter.screenName}`) meta(name='twitter:creator' content=`@${user.twitter.screenName}`)

View File

@ -25,8 +25,6 @@ block meta
meta(name='misskey:user-username' content=user.username) meta(name='misskey:user-username' content=user.username)
meta(name='misskey:user-id' content=user.id) meta(name='misskey:user-id' content=user.id)
meta(name='twitter:card' content='summary')
// todo // todo
if user.twitter if user.twitter
meta(name='twitter:creator' content=`@${user.twitter.screenName}`) meta(name='twitter:creator' content=`@${user.twitter.screenName}`)

View File

@ -26,9 +26,7 @@ block meta
meta(name='misskey:user-username' content=user.username) meta(name='misskey:user-username' content=user.username)
meta(name='misskey:user-id' content=user.id) meta(name='misskey:user-id' content=user.id)
meta(name='misskey:note-id' content=note.id) meta(name='misskey:note-id' content=note.id)
meta(name='twitter:card' content='summary')
// todo // todo
if user.twitter if user.twitter
meta(name='twitter:creator' content=`@${user.twitter.screenName}`) meta(name='twitter:creator' content=`@${user.twitter.screenName}`)

View File

@ -26,8 +26,6 @@ block meta
meta(name='misskey:user-id' content=user.id) meta(name='misskey:user-id' content=user.id)
meta(name='misskey:page-id' content=page.id) meta(name='misskey:page-id' content=page.id)
meta(name='twitter:card' content='summary')
// todo // todo
if user.twitter if user.twitter
meta(name='twitter:creator' content=`@${user.twitter.screenName}`) meta(name='twitter:creator' content=`@${user.twitter.screenName}`)

View File

@ -25,8 +25,6 @@ block meta
meta(name='misskey:user-username' content=user.username) meta(name='misskey:user-username' content=user.username)
meta(name='misskey:user-id' content=user.id) meta(name='misskey:user-id' content=user.id)
meta(name='twitter:card' content='summary')
if profile.twitter if profile.twitter
meta(name='twitter:creator' content=`@${profile.twitter.screenName}`) meta(name='twitter:creator' content=`@${profile.twitter.screenName}`)

View File

@ -59,7 +59,7 @@ class NotificationManager {
if (exist) { if (exist) {
// 「メンションされているかつ返信されている」場合は、メンションとしての通知ではなく返信としての通知にする // 「メンションされているかつ返信されている」場合は、メンションとしての通知ではなく返信としての通知にする
if (reason != 'mention') { if (reason !== 'mention') {
exist.reason = reason; exist.reason = reason;
} }
} else { } else {
@ -201,7 +201,7 @@ export default async (user: { id: User['id']; username: User['username']; host:
mentionedUsers.push(await Users.findOneOrFail(data.reply.userId)); mentionedUsers.push(await Users.findOneOrFail(data.reply.userId));
} }
if (data.visibility == 'specified') { if (data.visibility === 'specified') {
if (data.visibleUsers == null) throw new Error('invalid param'); if (data.visibleUsers == null) throw new Error('invalid param');
for (const u of data.visibleUsers) { for (const u of data.visibleUsers) {
@ -301,7 +301,7 @@ export default async (user: { id: User['id']; username: User['username']; host:
if (Users.isRemoteUser(user)) activeUsersChart.update(user); if (Users.isRemoteUser(user)) activeUsersChart.update(user);
// 未読通知を作成 // 未読通知を作成
if (data.visibility == 'specified') { if (data.visibility === 'specified') {
if (data.visibleUsers == null) throw new Error('invalid param'); if (data.visibleUsers == null) throw new Error('invalid param');
for (const u of data.visibleUsers) { for (const u of data.visibleUsers) {
@ -439,7 +439,7 @@ export default async (user: { id: User['id']; username: User['username']; host:
async function renderNoteOrRenoteActivity(data: Option, note: Note) { async function renderNoteOrRenoteActivity(data: Option, note: Note) {
if (data.localOnly) return null; if (data.localOnly) return null;
const content = data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length == 0) const content = data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0)
? renderAnnounce(data.renote.uri ? data.renote.uri : `${config.url}/notes/${data.renote.id}`, note) ? renderAnnounce(data.renote.uri ? data.renote.uri : `${config.url}/notes/${data.renote.id}`, note)
: renderCreate(await renderNote(note, false), note); : renderCreate(await renderNote(note, false), note);
@ -478,7 +478,7 @@ async function insertNote(user: { id: User['id']; host: User['host']; }, data: O
userId: user.id, userId: user.id,
localOnly: data.localOnly!, localOnly: data.localOnly!,
visibility: data.visibility as any, visibility: data.visibility as any,
visibleUserIds: data.visibility == 'specified' visibleUserIds: data.visibility === 'specified'
? data.visibleUsers ? data.visibleUsers
? data.visibleUsers.map(u => u.id) ? data.visibleUsers.map(u => u.id)
: [] : []
@ -502,7 +502,7 @@ async function insertNote(user: { id: User['id']; host: User['host']; }, data: O
insert.mentions = mentionedUsers.map(u => u.id); insert.mentions = mentionedUsers.map(u => u.id);
const profiles = await UserProfiles.find({ userId: In(insert.mentions) }); const profiles = await UserProfiles.find({ userId: In(insert.mentions) });
insert.mentionedRemoteUsers = JSON.stringify(mentionedUsers.filter(u => Users.isRemoteUser(u)).map(u => { insert.mentionedRemoteUsers = JSON.stringify(mentionedUsers.filter(u => Users.isRemoteUser(u)).map(u => {
const profile = profiles.find(p => p.userId == u.id); const profile = profiles.find(p => p.userId === u.id);
const url = profile != null ? profile.url : null; const url = profile != null ? profile.url : null;
return { return {
uri: u.uri, uri: u.uri,

View File

@ -39,7 +39,7 @@ export default async function(user: User, note: Note, quiet = false) {
let renote: Note | undefined; let renote: Note | undefined;
// if deletd note is renote // if deletd note is renote
if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length == 0)) { if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) {
renote = await Notes.findOne({ renote = await Notes.findOne({
id: note.renoteId, id: note.renoteId,
}); });

View File

@ -76,7 +76,7 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note,
// カスタム絵文字リアクションだったら絵文字情報も送る // カスタム絵文字リアクションだったら絵文字情報も送る
const decodedReaction = decodeReaction(reaction); const decodedReaction = decodeReaction(reaction);
let emoji = await Emojis.findOne({ const emoji = await Emojis.findOne({
where: { where: {
name: decodedReaction.name, name: decodedReaction.name,
host: decodedReaction.host, host: decodedReaction.host,

View File

@ -52,7 +52,7 @@ export default async function(
if (note.user != null) { // たぶんnullになることは無いはずだけど一応 if (note.user != null) { // たぶんnullになることは無いはずだけど一応
for (const antenna of myAntennas) { for (const antenna of myAntennas) {
if (await checkHitAntenna(antenna, note, note.user as any, undefined, Array.from(following))) { if (await checkHitAntenna(antenna, note, note.user, undefined, Array.from(following))) {
readAntennaNotes.push(note); readAntennaNotes.push(note);
} }
} }

View File

@ -114,9 +114,9 @@ export async function sendEmail(to: string, subject: string, html: string, text:
</html>`, </html>`,
}); });
logger.info('Message sent: %s', info.messageId); logger.info(`Message sent: ${info.messageId}`);
} catch (e) { } catch (err) {
logger.error(e); logger.error(err as Error);
throw e; throw err;
} }
} }

View File

@ -250,7 +250,15 @@ export default defineComponent({
}, },
interaction: { interaction: {
intersect: false, intersect: false,
mode: 'index',
}, },
elements: {
point: {
hoverRadius: 5,
hoverBorderWidth: 2,
},
},
animation: false,
plugins: { plugins: {
legend: { legend: {
display: props.detailed, display: props.detailed,

View File

@ -14,7 +14,7 @@ if (localStorage.getItem('accounts') != null) {
//#endregion //#endregion
import { computed, createApp, watch, markRaw, version as vueVersion } from 'vue'; import { computed, createApp, watch, markRaw, version as vueVersion } from 'vue';
import * as compareVersions from 'compare-versions'; import compareVersions from 'compare-versions';
import widgets from '@/widgets'; import widgets from '@/widgets';
import directives from '@/directives'; import directives from '@/directives';

View File

@ -1117,10 +1117,10 @@ csso@~2.3.1:
clap "^1.0.9" clap "^1.0.9"
source-map "^0.5.3" source-map "^0.5.3"
cypress@9.3.1: cypress@9.4.1:
version "9.3.1" version "9.4.1"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.3.1.tgz#8116f52d49d6daf90a91e88f3eafd940234d2958" resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.4.1.tgz#1a4ba706435829c24b7edf350c2b059e05da9084"
integrity sha512-BODdPesxX6bkVUnH8BVsV8I/jn57zQtO1FEOUTiuG2us3kslW7g0tcuwiny7CKCmJUZz8S/D587ppC+s58a+5Q== integrity sha512-+JgMG9uT+QFx97JU9kOHE3jO3+0UdkQ9H1oCBiC7A74qme7Jkdy2sYDBCPjjGczutnWnGUTMRlwiNMP/Uq6LrQ==
dependencies: dependencies:
"@cypress/request" "^2.88.10" "@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4" "@cypress/xvfb" "^1.2.4"
@ -1159,10 +1159,10 @@ cypress@9.3.1:
pretty-bytes "^5.6.0" pretty-bytes "^5.6.0"
proxy-from-env "1.0.0" proxy-from-env "1.0.0"
request-progress "^3.0.0" request-progress "^3.0.0"
semver "^7.3.2"
supports-color "^8.1.1" supports-color "^8.1.1"
tmp "~0.2.1" tmp "~0.2.1"
untildify "^4.0.0" untildify "^4.0.0"
url "^0.11.0"
yauzl "^2.10.0" yauzl "^2.10.0"
d@1, d@^1.0.1: d@1, d@^1.0.1:
@ -3422,11 +3422,6 @@ pumpify@^1.3.5:
inherits "^2.0.3" inherits "^2.0.3"
pump "^2.0.0" pump "^2.0.0"
punycode@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=
punycode@^2.1.0, punycode@^2.1.1: punycode@^2.1.0, punycode@^2.1.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
@ -3450,11 +3445,6 @@ query-string@^4.1.0:
object-assign "^4.1.0" object-assign "^4.1.0"
strict-uri-encode "^1.0.0" strict-uri-encode "^1.0.0"
querystring@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
queue-microtask@^1.2.2: queue-microtask@^1.2.2:
version "1.2.3" version "1.2.3"
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
@ -3736,7 +3726,7 @@ semver-greatest-satisfied-range@^1.1.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
semver@^7.3.5: semver@^7.3.2, semver@^7.3.5:
version "7.3.5" version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
@ -4353,14 +4343,6 @@ urix@^0.1.0:
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
url@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=
dependencies:
punycode "1.3.2"
querystring "0.2.0"
use@^3.1.0: use@^3.1.0:
version "3.1.1" version "3.1.1"
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"