* 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.
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.
* 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
* remove empty file
If the endpoint is to be implemented later, the file can be added back,
but for now it is confusing to have an empty file.
* enhance(doc): document defaults
Default for `isPublic` is based on the database schema default value.
Defaults for `local` and `withFiles` are based on the behaviour of the endpoint.
* enhance(doc): explain nullable emoji category
* fix: make nullable if default is null
* enhance(doc): explain mute attribute expiresAt
* fix: define required fields
- `notes/create`: the default for `text` has been removed because ajv can not handle
`default` inside of `anyOf`, see
https://ajv.js.org/guide/modifying-data.html#assigning-defaults
and the default value cannot be `null` if text is `nullable: false` in the `anyOf`
first alternative.
- `notes/create`: The `mediaIds` property has been marked as deprecated because it
has the same behaviour as using `fileIds`, but the implementation tries to handlè
`fileIds` first.
- The result schema for `admin/emoji/list` has been altered because the `host`
property will always be `null` as it is filtered this way in the database query.
See packages/backend/src/server/api/endpoints/admin/emoji/list.ts line 67.
* enhance(doc): explain nullable hostname
* update changelog
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* implement sending AP Flag object
Optionally allow a user to select to forward a report about a remote
user to the other instance. This is added in a backwards-compatible way.
* add locale string
* forward report only for moderators
* add switch to moderator UI to forward report
* fix report note url
* return forwarded status from API
apparently forgot to carry this over from my testing environment
* object in Flag activity has to be an array
For correct interoperability with Pleroma the "object" property of the Flag
activity has to be an array.
This array will in the future also hold the link to respective notes, so it
makes sense to correct this on our side.
* Update get-note-menu.ts
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* 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>