* 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.
* test(e2e): add baseline for widget tests
* chore(repo): enable test running in branch
* fix(e2e): set viewport for widget tests
* fix(client): add widget identifier classes to widgets
* test(e2e): add memo widget test
* fix(tests): force select value
* fix(tests): force button press for widget addition
* fix(tests): invoke select value differently
* fix(tests): adjust widget submit
* fix(tests): don't explicitly navigate for widget test
* fix(tests): click label to hide select popup
* fix(tests): just click modal background
* fix(tests): adjust modal background selector
* fix(tests): click all modal backgrounds
* feat(e2e): add test for adding timeline widget
* fix(client): add more widget identifier classes
* feat(tests): add method abstraction for test cases
* fix(tests): force-click overlays
* fix(tests): force widget button press
* fix(tests): remove timeout from final widget check
* feat(tests): add widget removal test case
* fix(client): use mk instead of msky as class prefix
* fix(tests): check widgets for existence rather than visibility
* chore(meta): don't run tests for specific feature branch
* enhance: rate limit works without signed in user
* fix: make limit key required for limiter
As before the fallback limiter key will be set from the endpoint name.
* enhance: use limiter for signin
* Revert "CAPTCHA求めるのは2fa認証が無効になっているときだけにした"
This reverts commit 02a43a310f.
* Revert "feat: make captcha required when signin to improve security"
This reverts commit b21b058005.
* fix undefined reference
* fix: better error message
* enhance: only handle prefix of IPv6
* fix: emits use ev instead of e
* fix: errors use err instead of e
* fix: replace use of data where possible
* fix: events use evt instead of e
* fix: use strict equals
* fix: use emoji instead of e
* fix: vue lints
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.
* simplify temporary files for thumbnails
Because only a single file will be written to the directory, creating a
separate directory seems unnecessary. If only a temporary file is created,
the code from `createTemp` can be reused here as well.
* refactor: deduplicate code for temporary files/directories
To follow the DRY principle, the same code should not be duplicated
across different files. Instead an already existing function is used.
Because temporary directories are also create in multiple locations,
a function for this is also newly added to reduce duplication.
* fix: clean up identicon temp files
The temporary files for identicons are not reused and can be deleted
after they are fully read. This condition is met when the stream is closed
and so the file can be cleaned up using the events API of the stream.
* fix: ensure cleanup is called when download fails
* fix: ensure cleanup is called in error conditions
This covers import/export queue jobs and is mostly just wrapping all
code in a try...finally statement where the finally runs the cleanup.
* fix: use correct type instead of `any`
* refactor to composition API
* use existing image component
This improves user experience because alt text is displayed correctly.
* fix: correct image src
* fix: defineProps
* fix
* enhance: make theme color format uniform
All newly fetched instance theme colors will be uniformely formatted
as hashtag followed by 6 hexadecimal digits.
Colors are checked for validity and invalid colors are not handled.
* better input validation for own theme color
* migration to unify theme color formats
Fixes theme colors of other instances as well as the local instance.
* add changelog entry
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* refactor(client): refactor file-dialog to use Composition API
* Apply review suggestion from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* refactor(client): refactor admin/integrations to use Composition API
* Apply review suggestions from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* refactor(client): refactor admin/queue to use Composition API
* Apply review suggestion from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* refactor(client): refactor admin/relays to use Composition API
* Apply review suggestion from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* refactor(client): refactor emoji-edit-dialog to use Composition API
* fix(client): fix editing emoji not updating emoji list
* Apply review suggestions from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* fix(client): use cached category info instead of making a request
* fix(client): use updateItem in emoji pagination when editing
* fix(client): reimplement removeItem in MkPagination
* Apply review suggestion from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* refactor(client): refactor admin/database to use Composition API
* Apply review suggestion from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* refactor(client): refactor admin/security to use Composition API
* Apply review suggestions from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
The cache implementation did previously not store the results of the
computation and was thus not a cache at all. This can cause a significant
number of database queries each time someone with a large number of
followers does something that causes an activity to be federated.
* fix(client): fix lint issues in post form
* Apply review suggestions from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
* chore: remove default null
null is always the default value if a table column is nullable, and typeorm's
@Column only accepts strings for default.
* chore: synchronize code with database schema
* chore: sync generated migrations with code