Commit graph

12 commits

Author SHA1 Message Date
Johann150 21ab8e75ee
activitypub: improve JSON-LD context
Added @type values for most definitions, and made name and value only
scoped to the PropertyValue type. (Blame Volpeon)
2023-05-30 17:57:03 +02:00
Johann150 b8796cb1fa
activitypub: remove _misskey_votes property
This is a duplication of `replies.totalItems` and seems unnecessary,
it is even only parsed by Misskey if the afforementioned property is
not available.

Changelog: Removed
2023-02-11 17:49:12 +01:00
Johann150 68bc2e314b
activitypub: remove _misskey_reaction property
This property is duplicated by the `content` property so seems unnecessary.

Changelog: Removed
2023-02-11 17:43:44 +01:00
Johann150 fff93c6965
activitypub: remove _misskey_content attribute
As already noted back in https://github.com/misskey-dev/misskey/pull/8787
the intention was to replace the `_misskey_content` attribute with the
ActivityPub-defined `source` property. Misskey and by extension Foundkey
have shipped with the `source` property and the respective parsing for
quite a while so it seems reasonable to remove it now.

Changelog: Removed
2023-02-11 17:25:24 +01:00
Johann150 48f8fb97df
activitypub: use quoteUri instead of quoteUrl
It's not quite Mastodon, but still, I said they'd use a different approach...

Changelog: Changed
2023-01-04 20:56:06 +01:00
Johann150 7a80015225
fix lint "no-param-reassign" 2022-08-10 16:36:54 +02:00
Johann150 37e47a257e
fix lints "import/order" and "import/no-duplicate"
Also simplified some import paths by replacing relative with absolute paths.
2022-08-03 14:05:50 +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 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
MeiMei d8905a9588
Unifying Misskey-specific IRIs in JSON-LD @context Resolve #8116 (#8178)
* Unifying Misskey-specific IRIs in JSON-LD `@context` Resolve #8116

* CHANGELOG
2022-01-23 01:52:35 +09:00
syuilo c69b72e199 fix lint 2021-12-09 23:58:30 +09:00
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00
Renamed from src/remote/activitypub/renderer/index.ts (Browse further)