Commit Graph

69 Commits (2644a28cb30dfb57b9543dd045657e8ed660876a)

Author SHA1 Message Date
Eugen Rochko 41a01bec23
Federated reports ()
* Fix : Federated reports

* UI for federated reports

* Add spec for ActivityPub Flag handler

* Add spec for ReportService
Eugen Rochko dbda87c31f
Revert ()
Eugen Rochko e4a241abef
Fix bad URL schemes being accepted ()
* Fix actors accepting invalid URI schemes or different host between URI and URL

* Fix statuses accepting invalid URI scheme or different host to actor

* Adjust tests to new requirements

* Improve readability of mismatching_origin?/invalid_origin? methods
Akihiko Odaki 161c72d66d Allow to dereference Follow object for ActivityPub ()
* Allow to dereference Follow object for ActivityPub

* Accept IRI as object representation for Accept activity
Eugen Rochko 85e97ecab6
Fix too many forwards ()
* Avoid sending explicit Undo->Announce when original deleted

* Do not forward a reply back to the server that sent it

* Deduplicate inboxes of rebloggers' followers for delete forwarding

* Adjust test

* Fix wrong class, bad SQL, wrong variable, outdated comment
unarist 8125fdc19f Use atomUri in Undo activity of Announce ()
This allows deletion of reblogs which delivered before with OStatus URI.
Eugen Rochko 3a3475450e Encode custom emojis as resolveable objects in ActivityPub ()
* Encode custom emojis as resolveable objects in ActivityPub

* Improve code style
Akihiko Odaki 98936bfcdf Add missing validations in ActivityPub::Activity::Create ()
Akihiko Odaki bb4d005a83 Introduce OStatus::TagManager ()
Eugen Rochko 81cec35dbf Custom emoji ()
* Custom emoji

- In OStatus: `<link rel="emoji" name="coolcat" href="http://..." />`
- In ActivityPub: `{ type: "Emoji", name: ":coolcat:", href: "http://..." }`
- In REST API: Status object includes `emojis` array (`shortcode`, `url`)
- Domain blocks with reject media stop emojis
- Emoji file up to 50KB
- Web UI handles custom emojis
- Static pages render custom emojis as `<img />` tags

Side effects:

- Undo  optimization, as I needed to modify it to restore
  shortcode handling in emojify()
- Formatter#plaintext should now make sure stripped out line-breaks
  and paragraphs are replaced with newlines

* Fix emoji at the start not being converted
unarist a12572e074 Handle stream_entry URL correctly in ActivityPub ()
In before, the method uses stream_entry id as status id, so replied status was wrongly selected.

This PR uses StatusFinder which was introduced with `Api::Web::EmbedsController`.
Eugen Rochko a4caa7eb62 Fetch statuses/following/followers numbers from ActivityPub collections ()
Eugen Rochko e7adbf572a Switch to static URIs, new URI format in both protocols for new statuses ()
* Decouple Status#local? from uri being nil

* Replace on-the-fly URI generation with stored URIs

- Generate URI in after_save hook for local statuses
- Use static value in TagManager when available, fallback to tag format
- Make TagManager use ActivityPub::TagManager to understand new format
- Adjust tests

* Use other heuristic for locality of old statuses, do not perform long query

* Exclude tombstone stream entries from Atom feed

* Prevent nil statuses from landing in Pubsubhubbub::DistributionWorker

* Fix URI not being saved ()

* Add more specs for Status

* Save generated uri immediately

and also fix method order to minimize diff.

* Fix alternate HTML URL in Atom

* Fix tests

* Remove not-null constraint from statuses migration to speed it up
Eugen Rochko 9a5ae09620 Remove identity context from output of LinkedDataSignature ()
Eugen Rochko 7b8f262840 Forward ActivityPub creates that reply to local statuses ()
* Forward ActivityPub creates that reply to local statuses

* Fix test

* Fix wrong signers
unarist 938cd2875b Fix Delete activity handling when the status has been reblogged ()
Eugen Rochko 00840f4f2e Add handling of Linked Data Signatures in payloads ()
* Add handling of Linked Data Signatures in payloads

* Add a way to sign JSON, fix canonicalization of signature options

* Fix signatureValue encoding, send out signed JSON when distributing

* Add missing security context
unarist a855956185 Fix ActivityPub follow interaction and add more specs ()
Eugen Rochko dd7ef0dc41 Add ActivityPub inbox ()
* Add ActivityPub inbox

* Handle ActivityPub deletes

* Handle ActivityPub creates

* Handle ActivityPub announces

* Stubs for handling all activities that need to be handled

* Add ActivityPub actor resolving

* Handle conversation URI passing in ActivityPub

* Handle content language in ActivityPub

* Send accept header when fetching actor, handle JSON parse errors

* Test for ActivityPub::FetchRemoteAccountService

* Handle public key and icon/image when embedded/as array/as resolvable URI

* Implement ActivityPub::FetchRemoteStatusService

* Add stubs for more interactions

* Undo activities implemented

* Handle out of order activities

* Hook up ActivityPub to ResolveRemoteAccountService, handle
Update Account activities

* Add fragment IDs to all transient activity serializers

* Add tests and fixes

* Add stubs for missing tests

* Add more tests

* Add more tests