diff --git a/packages/backend/migration/1675375940759-registry-remove-domain.js b/packages/backend/migration/1675375940759-registry-remove-domain.js index d3ee12ca9..41ca930f3 100644 --- a/packages/backend/migration/1675375940759-registry-remove-domain.js +++ b/packages/backend/migration/1675375940759-registry-remove-domain.js @@ -5,8 +5,8 @@ export class registryRemoveDomain1675375940759 { await queryRunner.query(`DROP INDEX "public"."IDX_0a72bdfcdb97c0eca11fe7ecad"`); await queryRunner.query(`ALTER TABLE "registry_item" DROP COLUMN "domain"`); await queryRunner.query(`ALTER TABLE "registry_item" ALTER COLUMN "key" TYPE text USING "key"::text`); - // delete existing duplicated entries, keeping the latest updated one - await queryRunner.query(`DELETE FROM "registry_item" AS "a" WHERE "updatedAt" != (SELECT MAX("updatedAt") FROM "registry_item" AS "b" WHERE "a"."userId" = "b"."userId" AND "a"."key" = "b"."key" AND "a"."scope" = "b"."scope" GROUP BY "userId", "key", "scope")`); + // delete existing duplicated entries, keeping the latest created one + await queryRunner.query(`DELETE FROM "registry_item" AS "a" WHERE "id" != (SELECT MAX("id") FROM "registry_item" AS "b" WHERE "a"."userId" = "b"."userId" AND "a"."key" = "b"."key" AND "a"."scope" = "b"."scope" GROUP BY "userId", "key", "scope")`); await queryRunner.query(`ALTER TABLE "registry_item" ADD CONSTRAINT "UQ_b8d6509f847331273ab99daccc7" UNIQUE ("userId", "key", "scope")`); } diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 6a796b223..060bc0cd6 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -270,16 +270,14 @@ export const UserRepository = db.getRepository(User).extend({ const followingCount = profile == null ? null : (profile.ffVisibility === 'public') || isMe ? user.followingCount : - (profile.ffVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount : + (profile.ffVisibility === 'followers') && relation?.isFollowing ? user.followingCount : null; const followersCount = profile == null ? null : (profile.ffVisibility === 'public') || isMe ? user.followersCount : - (profile.ffVisibility === 'followers') && (relation && relation.isFollowing) ? user.followersCount : + (profile.ffVisibility === 'followers') && relation?.isFollowing ? user.followersCount : null; - const falsy = opts.detail ? false : undefined; - const packed = { id: user.id, name: user.name, @@ -287,10 +285,10 @@ export const UserRepository = db.getRepository(User).extend({ host: user.host, avatarUrl: this.getAvatarUrlSync(user), avatarBlurhash: user.avatar?.blurhash || null, - isAdmin: user.isAdmin || falsy, - isModerator: user.isModerator || falsy, - isBot: user.isBot || falsy, - isCat: user.isCat || falsy, + isAdmin: user.isAdmin, + isModerator: user.isModerator, + isBot: user.isBot, + isCat: user.isCat, instance: !user.host ? undefined : userInstanceCache.fetch(user.host) .then(instance => !instance ? undefined : { name: instance.name, @@ -312,8 +310,8 @@ export const UserRepository = db.getRepository(User).extend({ bannerUrl: user.banner ? DriveFiles.getPublicUrl(user.banner, false) : null, bannerBlurhash: user.banner?.blurhash || null, isLocked: user.isLocked, - isSilenced: user.isSilenced || falsy, - isSuspended: user.isSuspended || falsy, + isSilenced: user.isSilenced, + isSuspended: user.isSuspended, description: profile!.description, location: profile!.location, birthday: profile!.birthday, @@ -369,7 +367,7 @@ export const UserRepository = db.getRepository(User).extend({ mutedInstances: profile!.mutedInstances, mutingNotificationTypes: profile!.mutingNotificationTypes, emailNotificationTypes: profile!.emailNotificationTypes, - showTimelineReplies: user.showTimelineReplies || falsy, + showTimelineReplies: user.showTimelineReplies, federateBlocks: user!.federateBlocks, } : {}), diff --git a/packages/backend/src/remote/activitypub/kernel/like.ts b/packages/backend/src/remote/activitypub/kernel/like.ts index 76272eea7..9650312b3 100644 --- a/packages/backend/src/remote/activitypub/kernel/like.ts +++ b/packages/backend/src/remote/activitypub/kernel/like.ts @@ -11,7 +11,7 @@ export default async (actor: CacheableRemoteUser, activity: ILike) => { await extractEmojis(activity.tag || [], actor.host).catch(() => null); - return await createReaction(actor, note, activity._misskey_reaction || activity.content || activity.name).catch(e => { + return await createReaction(actor, note, activity.content || activity.name).catch(e => { if (e.id === '51c42bb4-931a-456b-bff7-e5a8a70dd298') { return 'skip: already reacted'; } else { diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index fb9621b85..d7adc7b67 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -207,8 +207,6 @@ export async function createNote(value: string | IObject, resolver: Resolver, si let text: string | null = null; if (note.source?.mediaType === 'text/x.misskeymarkdown' && typeof note.source.content === 'string') { text = note.source.content; - } else if (typeof note._misskey_content !== 'undefined') { - text = note._misskey_content; } else if (typeof note.content === 'string') { text = fromHtml(note.content, quote?.uri); } diff --git a/packages/backend/src/remote/activitypub/models/question.ts b/packages/backend/src/remote/activitypub/models/question.ts index 5d88e1d44..803acee66 100644 --- a/packages/backend/src/remote/activitypub/models/question.ts +++ b/packages/backend/src/remote/activitypub/models/question.ts @@ -23,7 +23,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver .map(x => x.name!); const votes = question[multiple ? 'anyOf' : 'oneOf']! - .map(x => x.replies && x.replies.totalItems || x._misskey_votes || 0); + .map(x => x.replies && x.replies.totalItems || 0); return { choices, diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index 37e73d37b..b66f766a2 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -35,10 +35,7 @@ export const renderActivity = (x: any): IActivity | null => { value: 'schema:value', // Misskey misskey: 'https://misskey-hub.net/ns#', - '_misskey_content': 'misskey:_misskey_content', '_misskey_quote': 'misskey:_misskey_quote', - '_misskey_reaction': 'misskey:_misskey_reaction', - '_misskey_votes': 'misskey:_misskey_votes', '_misskey_talk': 'misskey:_misskey_talk', 'isCat': 'misskey:isCat', // vcard diff --git a/packages/backend/src/remote/activitypub/renderer/like.ts b/packages/backend/src/remote/activitypub/renderer/like.ts index 9d48e269e..a52d9c706 100644 --- a/packages/backend/src/remote/activitypub/renderer/like.ts +++ b/packages/backend/src/remote/activitypub/renderer/like.ts @@ -13,10 +13,7 @@ export const renderLike = async (noteReaction: NoteReaction, note: Note) => { id: `${config.url}/likes/${noteReaction.id}`, actor: `${config.url}/users/${noteReaction.userId}`, object: note.uri ? note.uri : `${config.url}/notes/${noteReaction.noteId}`, - ... (reaction !== '\u2b50' ? { - content: reaction, - _misskey_reaction: reaction, - } : {}), + content: reaction, } as any; if (reaction.startsWith(':')) { diff --git a/packages/backend/src/remote/activitypub/renderer/note.ts b/packages/backend/src/remote/activitypub/renderer/note.ts index 6fd50c158..5ca251617 100644 --- a/packages/backend/src/remote/activitypub/renderer/note.ts +++ b/packages/backend/src/remote/activitypub/renderer/note.ts @@ -145,7 +145,6 @@ export default async function renderNote(note: Note, dive = true, isTalk = false attributedTo, summary, content, - _misskey_content: text, source: { content: text, mediaType: 'text/x.misskeymarkdown', diff --git a/packages/backend/src/remote/activitypub/renderer/question.ts b/packages/backend/src/remote/activitypub/renderer/question.ts index d4d1b590a..a6116888a 100644 --- a/packages/backend/src/remote/activitypub/renderer/question.ts +++ b/packages/backend/src/remote/activitypub/renderer/question.ts @@ -11,7 +11,6 @@ export default async function renderQuestion(user: { id: User['id'] }, note: Not content: note.text || '', [poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({ name: text, - _misskey_votes: poll.votes[i], replies: { type: 'Collection', totalItems: poll.votes[i], diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index 28868297d..b4d0499c5 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -171,7 +171,6 @@ export const isQuestion = (object: IObject): object is IQuestion => interface IQuestionChoice { name?: string; replies?: ICollection; - _misskey_votes?: number; } export interface ITombstone extends IObject { type: 'Tombstone'; @@ -282,7 +281,7 @@ export interface IRemove extends IActivity { export interface ILike extends IActivity { type: 'Like' | 'EmojiReaction' | 'EmojiReact'; - _misskey_reaction?: string; + content?: string; } export interface IAnnounce extends IActivity { diff --git a/packages/backend/src/services/fetch-instance-metadata.ts b/packages/backend/src/services/fetch-instance-metadata.ts index ad312c3c8..71eb3269a 100644 --- a/packages/backend/src/services/fetch-instance-metadata.ts +++ b/packages/backend/src/services/fetch-instance-metadata.ts @@ -246,19 +246,20 @@ async function getSiteName(info: NodeInfo | null, doc: DOMWindow['document'] | n async function getDescription(info: NodeInfo | null, doc: DOMWindow['document'] | null, manifest: Record | null): Promise { if (info && info.metadata) { - if (info.metadata.nodeDescription || info.metadata.description) { - return info.metadata.nodeDescription || info.metadata.description; + const description = info.metadata.nodeDescription || info.metadata.description; + if (description && description.length < 4096) { + return description; } } if (doc) { const meta = doc.querySelector('meta[name="description"]')?.getAttribute('content'); - if (meta) { + if (meta && meta.length < 4096) { return meta; } const og = doc.querySelector('meta[property="og:description"]')?.getAttribute('content'); - if (og) { + if (og && og.length < 4096) { return og; } } diff --git a/packages/client/src/components/global/url.vue b/packages/client/src/components/global/url.vue index 47811ae00..5b4e831b1 100644 --- a/packages/client/src/components/global/url.vue +++ b/packages/client/src/components/global/url.vue @@ -35,7 +35,7 @@ const props = withDefaults(defineProps<{ const self = props.url.startsWith(local); const uri = new URL(props.url); -if (!['http:', 'https:'].includes(url.protocol)) throw new Error('invalid url'); +if (!['http:', 'https:'].includes(uri.protocol)) throw new Error('invalid url'); let el: HTMLElement | null = $ref(null); let schema = $ref(uri.protocol); diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 233e99aad..43ceb38a4 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -63,10 +63,29 @@ - {{ i18n.ts.youGotNewFollower }}
- {{ i18n.ts.followRequestAccepted }} - {{ i18n.ts.receiveFollowRequest }}
|
- {{ i18n.ts.groupInvited }}: {{ notification.invitation.group.name }}
|
+ + {{ i18n.ts.youGotNewFollower }} +
+ +
+
+ + {{ i18n.ts.followRequestAccepted }} + + + {{ i18n.ts.receiveFollowRequest }} +
+ | + +
+
+ + {{ i18n.ts.groupInvited }}: {{ notification.invitation.group.name }} +
+ | + +
+