about summary refs log tree commit diff
path: root/spec/services
AgeCommit message (Collapse)Author
2019-03-14Admission-based registrations mode (#10250)Eugen Rochko
Fix #6856 Fix #6951
2019-03-10Reject existing Follows when suspending a remote account (#10230)ThibG
* Reject existing Follows when suspending a remote account Partial fix to #10229 * Add tests
2019-02-28Improved remote thread fetching (#10106)ThibG
* Fetch up to 5 replies when discovering a new remote status This is used for resolving threads downwards. The originating server must add a “replies” attributes with such replies for it to be useful. * Add some tests for ActivityPub::FetchRepliesWorker * Add specs for ActivityPub::FetchRepliesService * Serialize up to 5 public self-replies for ActivityPub notes * Add specs for ActivityPub::NoteSerializer * Move exponential backoff logic to a worker concern * Fetch first page of paginated collections when fetching thread replies * Add specs for paginated collections in replies * Move Note replies serialization to a first CollectionPage The collection isn't actually paginable yet as it has no id nor a `next` field. This may come in another PR. * Use pluck(:uri) instead of map(&:uri) to improve performances * Fix fetching replies when they are in a CollectionPage
2019-02-26Add type, limit, offset, min_id, max_id, account_id to search API (#10091)Eugen Rochko
* Add type, limit, offset, min_id, max_id, account_id to search API Fix #8939 * Make the offset work on accounts and hashtags search as well * Assure brakeman we are not doing mass assignment here * Do not allow paginating unless a type is chosen * Fix search query and index id field on statuses instead of created_at
2019-01-26Prevent posting toots with media attachments from someone else (#9921)ThibG
2019-01-21Fix scheduled toot with media immediately creating a toot (#9894)ThibG
* Add test for not persisting status when attaching media to scheduled toot * Prevent status used for validation from being persisted to the database Fixes #9893 Thanks to tateisu for the help investigating this.
2019-01-18Reject existing Follow in addition to sending a Block (#9811)ThibG
Mastodon expects remote servers to remove follow relationships upon receiving a Block. However, the spec only evokes Block activities in a C2S context, never in a S2S context. This PR, in addition to federating the Block, explicitly sends a Reject for any affected follow relationship, which makes a bit more sense with regards to the spec.
2019-01-14Fix undefined method error in sidekiq (#9807)Renato "Lond" Cerqueira
* Fix undefined method error in sidekiq Body can be not nil but still be empty, which causes a `NoMethodError: undefined method `[]' for nil:NilClass` further in the code. This checks for an empty body to avoid the issue. * Fix codeclimate issue
2019-01-08Remove `pending` (#9752)ysksn
Some specs have already been added.
2019-01-05Add scheduled statuses (#9706)Eugen Rochko
Fix #340
2018-12-30Reduce usage of LD signatures (#9659)ThibG
* Do not LDS-sign Follow, Accept, Reject, Undo, Block * Do not use LDS for Create activities of private toots * Minor cleanup * Ignore unsigned activities instead of misattributing them * Use status.distributable? instead of querying visibility directly
2018-12-24Add REST API for creating an account (#9572)Eugen Rochko
* Add REST API for creating an account The method is available to apps with a token obtained via the client credentials grant. It creates a user and account records, as well as an access token for the app that initiated the request. The user is unconfirmed, and an e-mail is sent as usual. The method returns the access token, which the app should save for later. The REST API is not available to users with unconfirmed accounts, so the app must be smart to wait for the user to click a link in their e-mail inbox. The method is rate-limited by IP to 5 requests per 30 minutes. * Redirect users back to app from confirmation if they were created with an app * Add tests * Return 403 on the method if registrations are not open * Require agreement param to be true in the API when creating an account
2018-12-24Limit maximum visibility of local silenced users to unlisted (#9583)ThibG
Fixes #9580
2018-12-17 Ignore low-confidence CharlockHolmes guesses when parsing link cards (#9510)ThibG
* Add failing test for windows-1251 link cards * Ignore low-confidence CharlockHolmes guesses Fixes #9466 * Fix no method error when charlock holmes cannot detect charset
2018-11-25Ensure replied-to is a status not a boost (#9129)valerauko
* Ensure replied-to is a status not a boost * Consider case of not a reply * Add test case for replying to boost * Move reblog-reply resolution to model * Remove unnecessary comment
2018-11-22Ignore JSON-LD profile in mime type comparison (#9179)valerauko
Ignore JSON-LD profile in mime type comparison
2018-11-05Allow joining several hashtags in a single column (#8904)James Kiesel
* Nascent tag menu on frontend * Hook up frontend to search * Tag intersection backend first pass * Update yarnlock * WIP * Fix for tags not searching correctly * Make radio buttons function * Simplify radio buttons with modeOption * Better naming * Rearrange options * Add all/any/none functionality on backend * Small PR cleanup * Move to service from scope * Small cleanup, add proper service tests * Don't use send with user input :D * Set appropriate column header * Handle auto updating timeline * Fix up toggle function * Use tag value correctly * A bit more correct to use 'self' rather than 'all' in status scope * Fix some style issues * Fix more code style issues * Style select dropdown more better * Only use to_id'ed value to ensure no SQL injection * Revamp frontend to allow for multiple selects * Update backend / col header to account for more flexible tagging * Update brakeman ignore * Codeclimate suggestions * Fix presenter tag_url * Implement initial PR feedback * Handle additional tag streaming * CodeClimate tweak
2018-10-31Revert "Fix FetchAtomService content type handling (#9132)" (#9171)Eugen Rochko
This reverts commit c36a4a16178441968715e13c77859b1eb813c2af.
2018-10-30Fix FetchAtomService content type handling (#9132)valerauko
* Add profile to json+ld in Accept It's required by the ActivityPub spec * Use headers['Content-type'] instead of mime_type mime_type strips the profile from the content type, but it's still available raw in the headers hash * Add test for ld+json with profile
2018-10-30Do not hide boost notifications from followed people with hidden boosts (#9147)ThibG
* Do not hide boost notifications from followed people with hidden boosts Not displaying boosts from a followed user in the Home timeline and not having notifications when they reblog your own content are two very separate concerns, tying them together seem counter-intuitive and unwanted. * Update specs accordingly
2018-10-08rubocop issues - Cleaning up (#8912)ashleyhull-versent
* cleanup pass * undo mistakes * fixed. * revert
2018-10-04Fix link verification for remote accounts (#8868)Eugen Rochko
2018-10-04Lint pass (#8876)aus-social
2018-09-20Support link verification with redirects (#8735)Eugen Rochko
(e.g. URL shortener)
2018-09-19Fix failed profile verification when rel attribute including values other ↵Yamagishi Kazutoshi
than me (#8733)
2018-09-18Redesign forms, verify link ownership with rel="me" (#8703)Eugen Rochko
* Verify link ownership with rel="me" * Add explanation about verification to UI * Perform link verifications * Add click-to-copy widget for verification HTML * Redesign edit profile page * Redesign forms * Improve responsive design of settings pages * Restore landing page sign-up form * Fix typo * Support <link> tags, add spec * Fix links not being verified on first discovery and passive updates
2018-09-14Misc. typos (#8694)luzpaz
Found via `codespell -q 3 --skip="./app/javascript/mastodon/locales,./config/locales"`
2018-09-02Add preference for report notification e-mails, skip for duplicates (#8559)Eugen Rochko
If an unresolved report for the same target account already exists, no new notification is generated
2018-08-22Improve federated ID validation (#8372)Eugen Rochko
* Fix URI not being sufficiently validated with prefetched JSON * Add additional id validation to OStatus documents, when possible
2018-08-20Increase reach of Delete->Actor activities (#8305)Eugen Rochko
Fix #7316
2018-08-15Allow accessing local private/DM messages by URL (#8196)ThibG
* Allow accessing local private/DM messages by URL (Provided the user pasting the URL is authorized to see the toot, obviously) * Fix SearchServiceSpec tests
2018-06-09Fix domain hiding logic (#7765)Eugen Rochko
* Send rejections to followers when user hides domain they're on * Use account domain blocks for "authorized followers" action Replace soft-blocking (block & unblock) behaviour with follow rejection * Split sync and async work of account domain blocking Do not create domain block when removing followers by domain, that is probably unexpected from the user's perspective. * Adjust confirmation message for domain block * yarn manage:translations
2018-05-08Take the first recognized actor_type. (#7410)Surinna Curtis
2018-05-02Slightly reduce RAM usage (#7301)Eugen Rochko
* No need to re-require sidekiq plugins, they are required via Gemfile * Add derailed_benchmarks tool, no need to require TTY gems in Gemfile * Replace ruby-oembed with FetchOEmbedService Reduce startup by 45382 allocated objects * Remove preloaded JSON-LD in favour of caching HTTP responses Reduce boot RAM by about 6 MiB * Fix tests * Fix test suite by stubbing out JSON-LD contexts
2018-05-02Support Actors/Statuses with multiple types (#7305)Surinna Curtis
* Add equals_or_includes_any? helper in JsonLdHelper * Support arrays in JSON-LD type fields for actors/tags/objects. * Spec for resolving accounts with extension types * Style tweaks for codeclimate
2018-04-25Append '.test' to hostname in stub data (#7260)MIYAGI Hikaru
2018-04-23Prevent suspended accounts from appearing in AccountSearchService (#7246)Emelia Smith
2018-04-14Add bio fields (#6645)Eugen Rochko
* Add bio fields - Fix #3211 - Fix #232 - Fix #121 * Display bio fields in web UI * Fix output of links and missing fields * Federate bio fields over ActivityPub as PropertyValue * Improve how the fields are stored, add to Edit profile form * Add rel=me to links in fields Fix #121
2018-02-28Federated reports (#6570)Eugen Rochko
* Fix #2176: Federated reports * UI for federated reports * Add spec for ActivityPub Flag handler * Add spec for ReportService
2018-02-24Do not push status to feed if its reblog is already inserted (#6488)Akihiko Odaki
A complemental change for precompute_feed_service_spec.rb also fixes its random failure which is caused by the Snowlake randomization of the order of an original status and its reblog.
2018-02-18Added fetch_remote_status_service call spec case actibitypub (#6500)Kazushige Tominaga
* Added #link_header spec * Added #call spec * Delete spec of private methods * Added call test case activitypub
2018-02-11Fix URLs incorrectly having trailing hyphen removed (#6465)Daniel King
In cases where a URL has a trailing hyphen the FetchLinkCardService incorrectly removes the hyphen when it is parsed The hyphen is not a reserved character in the URI spec https://tools.ietf.org/html/rfc3986#section-2.2
2018-02-10Added FetchRemoteAccountService spec (#6456)Kazushige Tominaga
* Added #link_header spec * Added #call spec * Delete spec of private methods * Added #call spec
2018-02-10Added #call spec (#6455)Kazushige Tominaga
* Added #link_header spec * Added #call spec * Delete spec of private methods
2018-02-09Perform request spec (#6446)Kazushige Tominaga
* Added #link_header spec * Added #perform_request spec
2018-02-08Added #link_header spec (#6439)Kazushige Tominaga
2018-01-22Rename ResolveRemoteAccountService to ResolveAccountService (#6327)Akihiko Odaki
The service used to be named ResolveRemoteAccountService resolves local accounts as well.
2018-01-22Rename FetchRemoteResourceService to ResolveURLService (#6328)Akihiko Odaki
The service used to be named FetchRemoteResourceService resolves local URL as well.
2018-01-18When must_be_following_dm is on, only notify if recipient dm'ed user (#6283)Renato "Lond" Cerqueira
* When must_be_following_dm is on, only notify if recipient dm'ed user Currently, when must_be_following_dm is on, if a user sends a direct message replying to any status from the recipient, the recipient gets a notification. This should not be the case, as if the recipient posted something publicly this can be used to spam their notifications. * Refactor replied_to_status_is_direct_message? Following suggestion in PR
2018-01-17Use be_within instead of eq for a to_f test match (#6275)Mike Burns
Floating point values are notoriously hard to pin down, so use the `be_within` matcher to verify the approximate value.