Commit Graph

58 Commits

Author SHA1 Message Date
jaina heartles 80162565d6 Merge tag 'tags/2024.3.2' from upstream Sharkey 2024-03-31 16:31:48 -07:00
dakkar 074de82bf7 some validation fixes 2024-03-30 11:05:58 +00:00
jaina heartles 4af3b96746 Increase bio char limit 2024-03-06 17:26:35 -08:00
Marie 15d2319011
merge: upstream 2024-02-23 13:42:52 +01:00
okayurisotto 64953fadc9
refactor(backend): `Array.prototype.filter`での非null確認では`isNotNull`関数を使うように (#13442)
* `Array.prototype.filter`での非null確認では`isNotNull`関数を使うように

* `{}` -> `NonNullable<unknown>`
2024-02-23 14:12:57 +09:00
Marie 10bfc61670
merge: upstream 2024-02-19 10:47:42 +01:00
tamaina c1514ce91d (re) update SPDX-FileCopyrightText
Fix  #13290
2024-02-13 15:59:27 +00:00
tamaina 311c2172d7 Revert "update SPDX-FileCopyrightText"
This reverts commit 9b5aeb76d8.
2024-02-13 15:50:11 +00:00
syuilo 9b5aeb76d8 update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
Marie 6a94a52131
merge: upstream 2024-02-06 21:23:37 +01:00
Gianni Ceccarelli dabf1867fd
keep cached avatar&banner when refresh fails to get new values (#13145)
* keep cached avatar&banner when refresh fails to get new values

when the remote explicitly tells us a user image is gone, we remove
our cached value, but if we fail to get the image, we keep whatever
value we already have

this should minimise the problem of avatars randomly disappearing

* autogen bits

* pnpm run build-misskey-js-with-types

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2024-02-04 21:03:49 +09:00
Mar0xy 55ef4c4d93
upd: completely change handling of `indexable` 2023-11-17 15:05:58 +01:00
Mar0xy 2267f5a619
upd: change `indexable` value to `noindex`
As described in https://docs.joinmastodon.org/entities/Account/#noindex
2023-11-17 13:58:06 +01:00
Mar0xy 9cd2759769
feat: isIndexable 2023-11-07 19:16:57 +01:00
Mar0xy 35b3ac228c
merge: upstream 2023-11-05 11:19:03 +01:00
Marie 2cce28533f
fix(backend): isBot not being set on `Application` type (#12248)
* fix: bot not being set on all relays

* updatePerson missing the change

* chore: replace wrong word with correct word
2023-11-05 10:22:10 +09:00
Mar0xy 4dd23a3793
merge: upstream 2023-10-31 19:33:24 +01:00
かっこかり 117db08880
fix(backend): プロフィールの自己紹介欄のMFMを連合するように(実装漏れ) (#12185)
* (refactor) eliminate nested ternary operation

* fix lint

* Jissou more
2023-10-30 08:20:32 +09:00
かっこかり 59cc101752
fix(backend): プロフィールの自己紹介欄のMFMを連合するように (#12184)
* (fix) federate user description mfm

* fix

* Update Changelog
2023-10-29 19:33:35 +09:00
Mar0xy c79abfa8d9
fix: set remote users to approved on updates 2023-10-18 21:32:28 +02:00
Mar0xy 20e0d0b2e2
upd: mark remote users as approved 2023-10-18 20:56:41 +02:00
Mar0xy 6cac291d3d
fix: relays not getting accepted 2023-10-17 21:08:15 +02:00
Mar0xy 68886b9ab5
merge: upstream performance changes & instance silencing 2023-10-16 23:38:21 +02:00
syuilo 1fa1d31696 perf(backend): createdAtをidから取得するように & 無駄なDateインスタンスの生成を避けるように 2023-10-16 10:45:22 +09:00
Mar0xy 67cfa53118
upd: federate listenbrainz, fix background federation 2023-10-06 20:53:34 +02:00
Mar0xy 4e64397635
add: profile backgrounds 2023-10-06 02:32:09 +02:00
Mar0xy b216af65c5
fix: add type to AP User Update for speakAsCat 2023-10-04 04:38:38 +02:00
Mar0xy 4bf5c0856f
fix: speakAsCat not pulled on AP User Update 2023-10-04 04:37:51 +02:00
Mar0xy 89924b587a
add: speakAsCat extension 2023-10-04 04:35:58 +02:00
Mar0xy 2bcd2eefc1
change to default functions for resolving collections 2023-09-22 02:46:41 +02:00
Mar0xy 2bfe51e39d
upd: fetch counts for notes, followers and following 2023-09-22 02:23:17 +02:00
syuilo 053da10e94 refactor(backend): update directory structure for models 2023-09-20 11:33:36 +09:00
syuilo 6cf466e5d1
update deps (#11820)
* update deps

* fix

* wip

* wip

* wip

* Update docker-compose.yml.example

* Delete reviewer-lottery.yml

* Update RepositoryModule.ts

* wip

* wip

* clean up

* update deps

* wip

* wip
2023-09-15 14:28:29 +09:00
syuilo 792622aead
refactor: prefix Mi for all entities (#11719)
* wip

* wip

* wip

* wip

* Update RepositoryModule.ts

* wip

* wip

* wip

* Revert "wip"

This reverts commit c1c13b37d2aaf3c65bc148212da302b0eb7868bf.
2023-08-16 17:51:28 +09:00
woxtu 79966d33b5
Fix typos (#11450) 2023-08-05 13:56:33 +09:00
Shun Sakai c2370a1be6
chore: 著作権とライセンスについての情報を各ファイルに追加する (#11348)
* chore: Add the SPDX information to each file

Add copyright and licensing information as defined in version 3.0 of
the REUSE Specification.

* tweak format

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-07-27 14:31:52 +09:00
tamaina dc93a418c0
perf(backend): createPersonでキャッシュに保存する, DBのトランザクション回数を減らす (#11324)
* perf(backend): createPersonでキャッシュを積極的に利用する, トランザクション回数を減らす

* move comment

* fix

* oops

* fix

* fix

* fix
2023-07-20 14:44:37 +09:00
Kagami Sascha Rosylight 5059d4d7e1
refactor(backend): skip fetching notes when the data is same-origin (#11200)
* refactor(backend): skip fetching notes when the data is same-origin

* Update CHANGELOG.md

* sentFrom
2023-07-09 08:59:44 +09:00
okayurisotto 4f876c9e8d
refactor(backend): `core/activitypub/models` (#11067)
* cleanup(`ApImageService.ts`)

* refactor(`ApImageService.ts`)

* cleanup(`check-https.ts`)

* cleanup(`ApMentionService.ts`)

* refactor(`ApMentionService.ts`)

* cleanup(`ApNoteService.ts`): unneeded `eslint-disable-next-line`

* cleanup(`ApNoteService.ts`)

* WIP(`ApImageService.ts`): `image.url`を`getApHrefNullable()`に通すかどうか悩んでいる

* refactor(`ApNoteService.ts`): function return type

* cleanup(`ApNoteService.ts`): deadcode

* refactor(`ApNoteService.ts`): `eslint-disable-next-line`

* refactor(`ApNoteService.ts`): non-null assertion

これまでは`getApId()`の方でエラーがスローされていた。

* cleanup(`ApNoteService.ts`): unneeded await

* refactor(`ApNoteService.ts`): note.attachment

- `toArray()`を使うように
- よくわからない条件式を整理
- `as`をなくすために`promiseLimit()`でジェネリクスを使うように

* cleanup(`ApNoteService.ts`)

* refactor(`ApNoteService.ts`): よりよい型定義

`res`が`null`でないことは確認されているようだったので`null`とのunionはなくした

* refactor(`ApNoteService.ts`): 不要な条件を削除

* cleanup(`ApNoteService.ts`)

* cleanup(`ApNoteService.ts`): 重要でない`as`を削除

* refactor(`ApNoteService.ts`): `eslint-disable-next-line`

* cleanup(`ApNoteService.ts`): deadcode

* cleanup(`ApNoteService.ts`): unneeded non-null assertion

* refactor(`ApNoteService.ts`): 不要な条件を削除

* WIP(`ApNoteService.ts`): `as`をなくす

エラーメッセージを考える

* cleanup(`ApNoteService.ts`): 不要な`as`を削除

* cleanup(`ApPersonService.ts`): `no-unused-vars`

* cleanup(`ApPersonService.ts`): deadcode

* refactor(`ApPersonService.ts`): function return type

* cleanup(`ApPersonService.ts`): deadcode

* cleanup(`ApPersonService.ts`): deadcode

* WIP(`ApPersonService.ts`): `as`を調整

`null`でないか確認する処理が続いていたので型アサーションは`null`とのunionにした。
より本質的な改善の余地があるように感じるのでひとまずWIPとしてコミット。

* refactor(`ApPersonService.ts`): `eslint-disable-next-line`

* WIP(`ApPersonService.ts`): `as any`をなくした

エラーをスローするようにせざるを得なかったのでエラーメッセージを考える必要がある。

* WIP(`ApNoteService.ts`): non-null assertion

non-nullアサーションを減らすために事前に存在確認をするようにした。
エラーをスローするようにしたのでメッセージを考えなければならない。

* refactor(`ApNoteService.ts`): non-null assertion -> optional chaining

* refactor(`ApPersonService.ts`): `eslint-disable-next-line`

* refactor(`ApPersonService.ts`): `eslint-disable-next-line`

* refactor(`ApPersonService.ts`): function return type

* refactor(`ApPersonService.ts`): type guardによるnon-null assertionの削除

* WIP(`ApPersonService.ts`): `analyzeAttachments`

- Field型を事前に定義しておくように

- `attachments`が`IObject`だった場合、返り値が`{ fields: [] }`になるようだが構わないのか?
- `toArray()`を通すべきでは?

* Revert "WIP(`ApImageService.ts`): `image.url`を`getApHrefNullable()`に通すかどうか悩んでいる"

This reverts commit aeefb843a8a688f8a356794e8981c58f8a2733af.

* cleanup(`ApImageService.ts`): `import`

* refactor(`ApImageService.ts`): 冗長だった部分を短く

* cleanup(`ApMentionService.ts`): `import`

* refactor(`ApImageService.ts`): `JSON.stringify()`でのindentationを追加

* cleanup(`ApNoteService.ts`): `import`

* cleanup(`ApNoteService.ts`)

* cleanup(`ApNoteService.ts`)

* cleanup(`ApNoteService.ts`)

* cleanup(`ApNoteService.ts`): `any`に対するnon-null assertion

* refactor(`ApNoteService.ts`): 添付ファイル

* cleanup(`ApPersonService.ts`): `import`

* refactor(`ApPersonService.ts`): より実情に即した`as`に

* cleanup(`ApPersonService.ts`)

* refactor(`ApPersonService.ts`): 冗長だった部分を修正

* cleanup(`ApPersonService.ts`): deadcode

* cleanup(`ApPersonService.ts`)

* cleanup(`ApQuestionService.ts`): `import`

* refactor(`ApQuestionService.ts`): `eslint-disable-next-line`

* refactor(`ApQuestionService.ts`): `eslint-disable-next-line`

* cleanup(`ApQuestionService.ts`)

* refactor(`ApQuestionService.ts`): non-null assertionを消した

* cleanup(`ApQuestionService.ts`)

* WIP(`ApQuestionService.ts`): non-null assertionを消す

エラーメッセージを考える必要がある。

* refactor(`ApQuestionService.ts`): `any`を消す

* refactor(`ApQuestionService.ts`): function return type

* WIP(`ApPersonService.ts`): 可読性の低い三項演算子を削除しつつnon-null assertionを回避

エラーメッセージを考える必要がある。

* cleanup(`ApPersonService.ts`): 不必要な三項演算子を削除

* cleanup(`ApPersonService.ts`): 不要な`as`

* cleanup(`ApPersonService.ts`)

* refactor(`ApPersonService.ts`)

* refactor(`ApPersonService.ts`): 可読性の低い三項演算子を削除

元の実装が悪いと判断し`null`かどうかの確認をより厳密に行うようにした。

* cleanup(`ApPersonService.ts`)

* cleanup(`ApPersonService.ts`)

* refactor(`ApPersonService.ts`): 返り値を`void`に統一

この返り値を参照しているコードは見当たらなかった。
また、普通に意味がない値であるように見受けられた。

* fixup! refactor(`ApPersonService.ts`): 返り値を`void`に統一

* refactor(`ApNoteService.ts`)

* refactor(`ApPersonService.ts`)

* cleanup(`ApPersonService.ts`)

* cleanup(`ApPersonService.ts`)

* refactor(`ApPersonService.ts`): 返り値の`void`統一と条件式の調整

この返り値を参照しているコードは見当たらなかった。
また、普通に意味がない値であるように見受けられた。

* cleanup(`ApQuestionService.ts`)

* refactor(`ApQuestionService.ts`)

* refactor(`ApQuestionService.ts`)

* refactor(`tag.ts`): function return type

* fixup! enhance: account migration (#10592)

* fixup! WIP(`ApPersonService.ts`): 可読性の低い三項演算子を削除しつつnon-null assertionを回避

* fixup! cleanup(`ApPersonService.ts`): 不要な`as`

* refactor: エラーメッセージを見繕った

* Revert "cleanup(`ApImageService.ts`): `import`"

This reverts commit 1454d04c377eaf46013b0f3c3ce664a4034fd53a.

* Revert "cleanup(`ApMentionService.ts`): `import`"

This reverts commit 244f6720c134a3434e33c1caf6e3e0c2c87b58f5.

* Revert "cleanup(`ApNoteService.ts`): `import`"

This reverts commit d8f0d769733c4cb0629821b04e557a0ae6f5ff5b.

* Revert "cleanup(`ApPersonService.ts`): `import`"

This reverts commit 5190ef954caf376da46c707f52e02208d53caafd.

# Conflicts:
#	packages/backend/src/core/activitypub/models/ApPersonService.ts

* Revert "cleanup(`ApQuestionService.ts`): `import`"

This reverts commit 778585e2882477fec5f11fabf398b4b89cf26da2.

* processRemoteMoveはそのままにしてほしい

* Revert "fixup! refactor(`ApPersonService.ts`): 返り値を`void`に統一"

This reverts commit 083cd678abcd64325b9628895366c03b893e42ca.

* Revert "refactor(`ApPersonService.ts`): 返り値を`void`に統一"

This reverts commit bfa0fcd6f01a6e519ea0c68017358f9980d2ed96.

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2023-07-08 08:57:13 +09:00
okayurisotto d84796588c
cleanup: trim trailing whitespace (#11136)
* cleanup: trim trailing whitespace

* update(`.editorconfig`)

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-07-08 07:08:16 +09:00
syuilo d10d5a8d53 enhance: タイムラインにフォロイーの行った他人へのリプライを含めるかどうかの設定をアカウントに保存するのをやめるように
Resolve #10646
2023-05-16 12:16:37 +09:00
Namekuji d28866f71a
enhance: account migration (#10592)
* copy block and mute then create follow and unfollow jobs

* copy block and mute and update lists when detecting an account has moved

* no need to care promise orders

* refactor updating actor and target

* automatically accept if a locked account had accepted an old account

* fix exception format

* prevent the old account from calling some endpoints

* do not unfollow when moving

* adjust following and follower counts

* check movedToUri when receiving a follow request

* skip if no need to adjust

* Revert "disable account migration"

This reverts commit 2321214c98.

* fix translation specifier

* fix checking alsoKnownAs and uri

* fix updating account

* fix refollowing locked account

* decrease followersCount if followed by the old account

* adjust following and followers counts when unfollowing

* fix copying mutings

* prohibit moved account from moving again

* fix move service

* allow app creation after moving

* fix lint

* remove unnecessary field

* fix cache update

* add e2e test

* add e2e test of accepting the new account automatically

* force follow if any error happens

* remove unnecessary joins

* use Array.map instead of for const of

* ユーザーリストの移行は追加のみを行う

* nanka iroiro

* fix misskey-js?

* ✌️

* 移行を行ったアカウントからのフォローリクエストの自動許可を調整

* newUriを外に出す

* newUriを外に出す2

* clean up

* fix newUri

* prevent moving if the destination account has already moved

* set alsoKnownAs via /i/update

* fix database initialization

* add return type

* prohibit updating alsoKnownAs after moving

* skip to add to alsoKnownAs if toUrl is known

* skip adding to the list if it already has

* use Acct.parse instead

* rename error code

* 🎨

* 制限を5から10に緩和

* movedTo(Uri), alsoKnownAsはユーザーidを返すように

* test api res

* fix

* 元アカウントはミュートし続ける

* 🎨

* unfollow

* fix

* getUserUriをUserEntityServiceに

* ?

* job!

* 🎨

* instance => server

* accountMovedShort, forbiddenBecauseYouAreMigrated

* accountMovedShort

* fix test

* import, pin禁止

* 実績を凍結する

* clean up

* ✌️

* change message

* ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに

* Revert "ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに"

This reverts commit 3bd7be35d8aa455cb01ae58f8172a71a50485db1.

* validateAlsoKnownAs

* 移行後2時間以内はインポート可能なファイルサイズを拡大

* clean up

* どうせactorをupdatePersonで更新するならupdatePersonしか移行処理を発行しないことにする

* handle error?

* リモートからの移行処理の条件を是正

* log, port

* fix

* fix

* enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように

* refactor (use checkHttps)

* MISSKEY_WEBFINGER_USE_HTTP

* Environment Variable readme

* NEVER USE IN PRODUCTION

* fix punyHost

* fix indent

* fix

* experimental

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-04-30 00:09:29 +09:00
tamaina 09764b909b
enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように (#10717)
* enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように

* refactor (use checkHttps)

* MISSKEY_WEBFINGER_USE_HTTP

* Environment Variable readme

* NEVER USE IN PRODUCTION

* fix punyHost
2023-04-29 23:26:47 +09:00
Namekuji 25ebb73756
feat: account migration (#10507)
* add Move activity

* add endpoint to move from local to remote

* follow move activity coming to inbox

* fix move endpoint

* add known-as endpoint to create account alias

* add migration page

* add route to migration page

* add move and known-as endpoints

* fix dependnecies error

* fix new endpoints

* fix move activity id

* fix refollow

* add movedToUri and alsoKnownAs to api

* fix moveToUri indicator

* fix missing context

* add chengelog

* rename MkMoved to MkAccountMoved

* add missing semicolon

* fix targetUri

* fix followings query

* remove redundant null check
2023-04-08 14:16:26 +09:00
syuilo 521eb95dbc perf(backend): cache avatar and banner url to db 2023-04-06 19:48:24 +09:00
syuilo ecaf152b4a enhance(backend): improve cache 2023-04-04 17:32:09 +09:00
syuilo 31f3f5f0f0 enhance(backend): リモートサーバーのチャート生成を無効にするオプションを追加 2023-03-24 19:08:08 +09:00
Kagami Sascha Rosylight 194d656bb4 fix: normalize empty value of `name` into an absent value 2023-02-17 09:06:48 +01:00
Kagami Sascha Rosylight 63df2c851e
refactor: remove all unused imports (#9951)
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2023-02-16 23:09:41 +09:00
syuilo 1b21bad202 refactor 2023-02-13 15:50:22 +09:00