Commit graph

37 commits

Author SHA1 Message Date
Johann150 f883d2e31b
fix showing follower/following count 2023-05-27 20:42:10 +02:00
Johann150 a3c7571670
add missing comma 2023-05-23 23:56:30 +02:00
Johann150 4312393169
Revert 'Revert "server: fix user deletion race condition"'
This reverts commit bb3ec8bafe.
2023-05-23 21:49:33 +02:00
Johann150 fe65cba9be
add "nobody" follower visibility
Adds a new follower/following visibility that hides followers even from
yourself.

Changelog: Added
2023-05-20 23:18:57 +02:00
Johann150 ed9f2f4900
server: refactor ffVisibility checks into function 2023-05-20 23:18:56 +02:00
Johann150 9b8438cdfc
server: system accounts cannot be registered
While refactoring the previous commit, it seemed like the previous
authors expected that a system account could be registered somehow
and that this would be an error condition. However, as now made
explicit with this, it is not possible to register a system account.

This means that any account by that name could only ever have been
created by the system itself so fetching them should be fine and not
an error condition.
2023-04-20 22:10:31 +02:00
Johann150 c1f7ad0c14
server: add movedTo to packed user 2023-03-23 21:45:59 +01:00
Johann150 c9d395961e
server: refactor packing User 2023-02-11 19:17:11 +01:00
Chloe Kudryavtsev bb3ec8bafe Revert "server: fix user deletion race condition"
This reverts commit cc83cbe523, reversing
changes made to 8abd3ebec7.

This changeset contains:
* multiple type errors
* a foreign key incompatibility
* breaks outgoing note federation (in at least two ways)
2023-01-30 14:59:24 +01:00
Johann150 cc83cbe523
server: fix user deletion race condition
Changelog: Fixed
Ref: https://github.com/misskey-dev/misskey/issues/7506
2023-01-29 12:53:29 +01:00
Johann150 3d2cfc075a
fixup: actually check whether the group joining is from the user 2023-01-13 21:55:14 +01:00
Johann150 85e985d13f
server: change data structure to track deletion completion 2023-01-08 21:21:54 +01:00
Johann150 4fe288f17c server: rewrite user status queries in SQL 2023-01-08 20:02:21 +00:00
Johann150 a673647fba
server: remove avatarColor and bannerColor properties
According to comments next to those properties, they were kept for backward compatibility.
However they were always being set to null.

Changelog: Removed
2022-12-26 18:52:16 +01:00
Norm 3cf673960b server: Fix typing for user token
Also fix a comment in the User model that wrongly states that the token
is null if the user is local, when it's the opposite.
2022-12-08 23:20:41 -05:00
Andy b023741f50 server: remove integrations field from user 2022-12-06 23:00:08 +01:00
Johann150 11e4a8cb9b
remove erroneous space 2022-12-04 15:34:05 +01:00
Norm 71b3b5a60c backend: implement not forwarding block activities (#212)
Fixes FoundKeyGang/FoundKey#211

Commits pulled from https://github.com/misskey-dev/misskey/pull/7799

Changelog: Added
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Co-authored-by: Johann150 <johann.galle@protonmail.com>
Co-authored-by: Francis Dinh <normandy@biribiri.dev>
Reviewed-on: FoundKeyGang/FoundKey#212
2022-11-17 21:24:38 +00:00
Johann150 d1ec058d5c
server: refactor Cache to hold fetcher as attribute
Instead of having to pass the fetcher every time you want to fetch
something, the fetcher is stored in an attribute of the Cache.
2022-11-13 19:39:30 +01:00
Johann150 66a9d27ab1
server: increase user description length to 2048
Changelog: Changed
2022-11-11 12:28:57 +01:00
Hélène c414f24a2c feat: per-user renote muting
Changelog: Added
2022-10-11 10:42:39 +00:00
Johann150 c8f49bae76
fix lint "object-shorthand" 2022-08-03 14:58:24 +02:00
Johann150 dc6884898d
chore: remove unused imports 2022-07-11 15:31:09 +02:00
Johann150 804fa33535
refactor: improve code quality (#8751)
* remove unnecessary if

`Array.prototype.some` already returns a boolean so an if to return
true or false is completely unnecessary in this case.

* perf: use count instead of find

When using `count` instead of `findOneBy`, the data is not
unnecessarily loaded.

* remove duplicate null check

The variable is checked for null in the lines above and the function
returns if so. Therefore, it can not be null at this point.

* simplify `getJsonSchema`

Because the assigned value is `null` and the used keys are only
shallow, use of `nestedProperty.set` seems inappropriate. Because the
value is not read, the initial for loop can be replaced by a `for..in`
loop.

Since all keys will be assigned `null`, the condition of the ternary
expression in the nested function will always be true. Therefore the
recursion case will never happen. With this the nested function can be
eliminated.

* remove duplicate condition

The code above already checks `dragging` and returns if it is truthy.
Checking it again later is therefore unnecessary.

To make this more obvious the `return` is removed in favour of using
an if...else construct.

* remove impossible "unknown" time

The `ago` variable will always be a number and all non-negative numbers
are already covered by other cases, the negative case is handled with
`future` so there is no case when `unkown` could be achieved.
2022-05-29 15:15:52 +09:00
syuilo d338ea2591 fix ogp rendering and refactor 2022-04-17 21:18:18 +09:00
syuilo 1c67c26bd8
refactor: migrate to typeorm 3.0 (#8443)
* wip

* wip

* wip

* Update following.ts

* wip

* wip

* wip

* Update resolve-user.ts

* maxQueryExecutionTime

* wip

* wip
2022-03-26 15:34:00 +09:00
syuilo eb9e6d230f perf(server): reduce db query 2022-03-21 01:22:00 +09:00
tamaina e314be5b59
Fix avatar/banner proxy (#8346)
* Fix avatar/banner proxy

Co-authored-by: mei23 <m@m544.net>

* use getAvatarUrl

* fix

* join avatar and banner to improve performance

* join

* Update hybrid-timeline.ts

* fix

Co-authored-by: mei23 <m@m544.net>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2022-02-27 13:59:10 +09:00
syuilo d071d18dd7
refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00
syuilo 510de87607
refactor: use ajv instead of cafy (#8324)
* wip

* wip

* Update abuse-user-reports.ts

* Update files.ts

* Update list-remote.ts

* Update list.ts

* Update show-users.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update update.ts

* Update search.ts

* Update reactions.ts

* Update search.ts

* wip

* wip

* wip

* wip

* Update update.ts

* Update relation.ts

* Update available.ts

* wip

* wip

* wip

* Update packages/backend/src/server/api/define.ts

Co-authored-by: Johann150 <johann.galle@protonmail.com>

* Update define.ts

* Update define.ts

* typo

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update update.ts

* wip

* Update signup.ts

* Update call.ts

* minimum for limit

* type

* remove needless annotation

* wip

* Update signup.ts

* wip

* wip

* fix

* Update create.ts

Co-authored-by: Johann150 <johann.galle@protonmail.com>
2022-02-19 14:05:32 +09:00
nullobsi 3ff89fa7ec
feat: Option to show replies in timeline (rebase #7685) (#8202)
* Add an option for timeline replies. Credit to Emilis (puffaboo)

* update db on request
2022-02-06 16:02:48 +09:00
tamaina efb0ffc4ec
refactor: APIエンドポイントファイルの定義を良い感じにする (#8154)
* Fix API Schema Error

* Delete SimpleSchema/SimpleObj
and Move schemas to dedicated files

* Userのスキーマを分割してみる

* define packMany type

* add ,

* Ensure enum schema and Make "as const" put once

* test?

* Revert "test?"

This reverts commit 97dc9bfa70851bfb7d1cf38e883f8df20fb78b79.

* Revert "Fix API Schema Error"

This reverts commit 21b6176d974ed8e3eb73723ad21a105c5d297323.

* ✌️

* clean up

* test?

* wip

* wip

* better schema def

* ✌️

* fix

* add minLength property

* wip

* wip

* wip

* anyOf/oneOf/allOfに対応? ~ relation.ts

* refactor!

* Define MinimumSchema

* wip

* wip

* anyOf/oneOf/allOfが動作するようにUnionSchemaTypeを修正

* anyOf/oneOf/allOfが動作するようにUnionSchemaTypeを修正

* Update packages/backend/src/misc/schema.ts

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* fix

* array oneOfをより正確な型に

* array oneOfをより正確な型に

* wip

* ✌️

* なんかもういろいろ

* remove

* very good schema

* api schema

* wip

* refactor: awaitAllの型定義を変えてみる

* fix

* specify types in awaitAll

* specify types in awaitAll

* ✌️

* wip

* ...

* ✌️

* AllowDateはやめておく

* 不必要なoptional: false, nullable: falseを廃止

* Packedが展開されないように

* 続packed

* wip

* define note type

* wip

* UserDetailedをMeDetailedかUserDetailedNotMeかを区別できるように

* wip

* wip

* wip specify user type of other schemas

* ok

* convertSchemaToOpenApiSchemaを改修

* convertSchemaToOpenApiSchemaを改修

* Fix

* fix

* ✌️

* wip

* 分割代入ではなくallOfで定義するように

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
2022-01-18 22:27:10 +09:00
syuilo 2c36844d34 refactor: more common name 2022-01-16 10:45:48 +09:00
syuilo c69b72e199 fix lint 2021-12-09 23:58:30 +09:00
romaboo 054417354c
feat: user-level instance mute (#7712)
* Update ja-JP.yml

* Added settable config for muted instances

* added psql query for removal of muted notes

* Added filtering and trimming for instance mutes

* cleaned up filtering of bad instance mutes and added a refresh at the end for the list on the client

* Added notification & streaming timeline muting

* Updated changelog

* Added missing semicolon

* Apply japanese string suggestions from robflop

Co-authored-by: Robin B. <robflop98@outlook.com>

* Changed Ja-JP instance mute title string to one suggested by sousuke

Co-authored-by: sousuke0422 <sousuke20xx@gmail.com>

* Update ja-JP instanceMuteDescription based on sousuke's suggestion

Co-authored-by: sousuke0422 <sousuke20xx@gmail.com>

* added notification mute

* added notification and note children muting

* Fixed a bug where local notifications were getting filtered on cold start

* Fixed instance mute imports

* Fixed not saving/loading instance mutes

* removed en-US translations for instance mute

* moved instance mute migration to js

* changed settings index back to spaces

* removed destructuring assignment from notification stream in instance mute check call

Co-authored-by: tamaina <tamaina@hotmail.co.jp>

* added .note accessor for checking note data instead of notification data

* changed note to use Packed<'Note'> instead of any and removed usage of snake case

Co-authored-by: tamaina <tamaina@hotmail.co.jp>

* changed notification mute check to check specifically for notification host

* changed to using single quotes

* moved @click to the end for the linter

* revert unnecessary changes

* restored newlines

* whitespace removal

Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Co-authored-by: Robin B. <robflop98@outlook.com>
Co-authored-by: sousuke0422 <sousuke20xx@gmail.com>
Co-authored-by: puffaboo <emilis@jigglypuff.club>
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
2021-12-09 21:38:56 +09:00
syuilo 8223a069fe fix(server): Fix #8032 2021-12-03 17:47:44 +09:00
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00
Renamed from src/models/repositories/user.ts (Browse further)