Commit graph

32 commits

Author SHA1 Message Date
Laura Hausmann ef3463e8dc
[backend] Rework note hard mutes
It's been shown that the current approach doesn't scale. This implementation should scale perfectly fine.
2023-11-27 19:43:45 +01:00
Laura Hausmann 3ccfd0417b
[backend] Improve renote status aggregate query 2023-11-24 21:14:17 +01:00
Laura Hausmann 735fd37707
[backend] Only pack each user once per request 2023-11-22 20:25:47 +01:00
Laura Hausmann a6fa393359
[backend] Return isRenoted status in Notes.pack instead of requesting it individually 2023-11-21 01:00:14 +01:00
Laura Hausmann b462e9d1fc
chore: code reformat 2023-07-27 00:44:38 +02:00
Laura Hausmann 37aaeb8093
Fix reply visibility errors 2023-07-23 13:33:39 +02:00
Namekuji f03861a189 add refresh button to poll 2023-06-18 17:14:38 -04:00
ThatOneCalculator 0a45449108 chore: formatting 2023-05-25 19:47:10 -07:00
Freeplay d9c8c7af98 Fix polls & own reactions not showing in replies 2023-05-25 15:49:39 -04:00
Kaity A 89716480e5 fix poll voting causing edit revisions. 2023-05-01 03:17:38 +10:00
Kaity A 6a509637d5 Implement inbound note edit federation 2023-05-01 02:29:50 +10:00
Kaity A eaa6bc2da3 Separate cat-avatar mode and speak-as-cat nyanification 2023-04-02 21:24:12 +10:00
ThatOneCalculator 33718bdd5d chore: 🎨 format 2023-04-01 21:10:31 -07:00
kabo2468 021f667976 fix: don't nyaize quoted text 2023-03-31 23:30:57 +09:00
ThatOneCalculator ae9ba9b2c3 Revert "refactor: nyaize on the frontend"
This reverts commit aff90b3ef225e5d4453469b36b7bf3a8565c7a68.
2023-03-23 09:06:32 -07:00
ThatOneCalculator 887673ecdd refactor: nyaize on the frontend 2023-03-19 19:59:00 -07:00
ThatOneCalculator 13238973b6 chore: Rome Formatting 2023-02-10 15:41:19 -08:00
cutestnekoaqua b1e3c2e1c7 feat: v1 Mastodon API
This commit adds (maybe unstable) support for Mastodons v1 api
also some v2 endpoints, maybe I miss stuff, I dont know.
We will need to test this but it should be kinda stable
and work like (old) butter.

Co-authored-by: Natty <natty.sh.git@gmail.com>
Co-authored-by: cutls <web-pro@cutls.com>
2023-02-09 23:21:50 +01:00
ThatOneCalculator 2aab2de38d refactor: 🎨 rome 2023-01-12 20:40:33 -08:00
Johann150 fed2085138 Merge: enhance privacy of notes
https://akkoma.dev/FoundKeyGang/FoundKey/pulls/14
2022-07-25 13:36:44 -07:00
Johann150 e161c0abe4 chore: synchronize visibility checks (#8687)
* reuse single meId parameter

* unify code style

Use template string to avoid having to use escaped quote marks.

* fix: follower only notes are visible to mentioned users

This synchronizes the visibility rules with the Notes.isVisibleForMe
method from packages/backend/src/models/repositories/note.ts

* add comment
2022-06-11 16:14:44 +09:00
Johann150 ec47b46423 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
Johann150 62ab5b4015 fix: assume remote users are following each other (#8734)
Misskey does not know if two remote users are following each other.
Because ActivityPub actions would otherwise fail on followers only
notes, we have to assume that two remote users are following each other
when an interaction about a remote note occurs.
2022-05-25 23:17:00 +09:00
syuilo c09c75c625 refactor and performance improvements 2022-03-26 17:19:27 +09:00
syuilo 523ee14a73 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 94228778c9 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 b13aebab57 refactor 2022-02-25 20:03:17 +09:00
syuilo 81c7db0744 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
tamaina 66ef4f1ebe 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 9b8d526ed0 fix lint 2021-12-09 23:58:30 +09:00
syuilo a39c964847 viaMobileフラグ廃止
Close #7965
2021-11-12 15:11:20 +09:00
syuilo 14148f6c4a refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00
Renamed from src/models/repositories/note.ts (Browse further)