about summary refs log tree commit diff
path: root/app/services
AgeCommit message (Collapse)Author
2019-04-25Reject follow requests of blocked users (#10633)ThibG
2019-04-21Treat meta[property] as a space-separated list (#10604)Daniel Aleksandersen
The @property attribute in HTML is a space-separated list of values. This change normalizes whitespace and finds the desired value in the list instead of requiring an exact single-value match. More details: https://www.ctrl.blog/entry/rdfa-socialmedia-metadata.html
2019-04-08Export and import show_reblogs together with following list (#10495)ThibG
* Refactor imports * Export show_reblogs when exporting list of followed users * Add support for importing show_reblogs with following collection * Fix tests
2019-04-07Improve blocked view of profiles (#10491)Eugen Rochko
* Revert "Fix filtering of favourited_by, reblogged_by, followers and following (#10447)" This reverts commit 120544067fcca4bf6e71ba1ffb276c451c17c656. * Revert "Hide blocking accounts from blocked users (#10442)" This reverts commit 62bafa20a112ccdddaedb25723fc819dbbcd8e9a. * Improve blocked view of profiles - Change "You are blocked" to "Profile unavailable" - Hide following/followers in API when blocked - Disable follow button and show "Profile unavailable" on public profile as well
2019-04-03Export and import `hide_notifications` alongside user mutes (#10335)ThibG
* Export hide_notifications along with user mutes * Import hide_notifications along with muted users list * Add headers for CSV exports
2019-04-01Hide blocking accounts from blocked users (#10442)ThibG
* Revert "Add indication that you have been blocked in web UI (#10420)" This reverts commit bd02ec6daa974dcd3231e73826a56e08dbeedadc. * Revert "Add `blocked_by` relationship to the REST API (#10373)" This reverts commit 9745de883b198375ba23f7fde879f6d75ce2df0f. * Hide blocking accounts from search results * Filter blocking accouts from account followers * Filter blocking accouts from account's following accounts * Filter blocking accounts from “reblogged by” and “favourited by” lists * Remove blocking account from URL search * Return 410 on trying to fetch user data from a user who blocked us * Return 410 in /api/v1/account/statuses for suspended or blocking accounts * Fix status filtering when performing URL search * Restore some React improvements Restore some cleanup from bd02ec6daa974dcd3231e73826a56e08dbeedadc * Refactor by adding `without_blocking` scope
2019-03-30Add ActivityPub representation for identity proofs (#10414)Eugen Rochko
* Add ActivityPub representation for identity proofs * Add tests
2019-03-28Rename :poll to :preloadable_poll and :owned_poll to :poll on Status (#10401)Eugen Rochko
Also, fix some n+1 queries Resolve #10365
2019-03-23Fix vote-after-expiration not showing error, count vote as interaction (#10352)Eugen Rochko
2019-03-21Fix processing poll Updates (#10333)ThibG
ActivityPub::ProcessPollService was checking the JSON-LD context although it was passed only the `Question` object embedded in the `Update` activity.
2019-03-19Do not distribute Delete when rejecting unapproved accounts (#10321)ThibG
2019-03-17Set and store report URIs (#10303)ThibG
Fixes #10271
2019-03-16Avoid race condition when streaming deleted statuses (#10280)ThibG
* Avoid race condition when streaming deleted statuses * Move redis lock to DistributionWorker to avoid extra Redis value
2019-03-15Fix detailed poll validation errors not being returned in the API (#10261)Eugen Rochko
No more "Owned poll is invalid"
2019-03-15Add `visibility` param to reblog REST API (#9851)Eugen Rochko
Use async worker for creating reblog notification to improve performance
2019-03-14Admission-based registrations mode (#10250)Eugen Rochko
Fix #6856 Fix #6951
2019-03-12Fix poll update handler calling method was that was not available (#10246)Eugen Rochko
* Fix poll update handler calling method was that was not available Fix regression from #10209 * Refactor VoteService * Refactor ActivityPub::DistributePollUpdateWorker and optimize it * Fix typo * Fix typo
2019-03-12Optimize RemoveStatusService by removing n+1 query and using shared inboxes ↵Eugen Rochko
(#10247)
2019-03-11Support pushing and receiving updates to poll tallies (#10209)ThibG
* Process incoming poll tallies update * Send Update on poll vote * Do not send Updates for a poll more often than once every 3 minutes * Include voters in people to notify of results update * Schedule closing poll worker on poll creation * Add new notification type for ending polls * Add front-end support for ended poll notifications * Fix UpdatePollSerializer * Fix Updates not being triggered by local votes * Fix tests failure * Fix web push notifications for closing polls * Minor cleanup * Notify voters of both remote and local polls when those close * Fix delivery of poll updates to mentioned accounts and voters
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-03-08Do not allow adding votes to expired polls (#10214)ThibG
* Do not allow adding votes to expired polls * Only validate expires_at on create
2019-03-07Handle StaleObjectError when retrieving polls (#10208)ThibG
2019-03-05Do not error out on unsalvageable errors in FetchRepliesService (#10175)ThibG
* Do not error out on unsalvageable errors in FetchRepliesService Fixes #10152 * Fix FetchRepliesWorker erroring out on deleted statuses
2019-03-05Fix suspended account's fields being set as empty dict instead of list (#10178)ThibG
Fixes #10177
2019-03-05Fix last_fetched_at not being set on polls (#10170)Eugen Rochko
2019-03-04Fix another typo in ActivityPub::FetchRemotePollService (#10146)Eugen Rochko
2019-03-04Fix typo in ActivityPub::FetchRemotePollService (#10145)Eugen Rochko
2019-03-04Fix remote poll expiration time (#10144)Eugen Rochko
2019-03-04Correctly make polls and media mutually exclusive (#10141)ThibG
2019-03-04Make sure the poll is created before storing its id (#10142)ThibG
* Make sure the poll is created before storing its id * Fix updating poll results * Support fetching Question activities from the search bar
2019-03-03Add polls (#10111)Eugen Rochko
* Add polls Fix #1629 * Add tests * Fixes * Change API for creating polls * Use name instead of content for votes * Remove poll validation for remote polls * Add polls to public pages * When updating the poll, update options just in case they were changed * Fix public pages showing both poll and other media
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-02-24Skip some methods in BatchedRemoveStatusService when account is nil (#10095)NOGISAKA Sadata
* Skip some methods in BatchedRemoveStatusService when account is nil Sometimes `bin/tootctl accounts cull` fails with below error: undefined method `followers_for_local_distribution' for nil:NilClass (NoMethodError) This commit makes BatchedRemoveStatusService to skip below methods when `account` is nil: - unpush_from_home_timelines() - unpush_from_list_timelines() - batch_stream_entries() * Fix rubocop error: Use `next` to skip iteration.
2019-02-13Filter incoming Create activities by relation to local activity (#10005)Eugen Rochko
Reject those from accounts with no local followers, from relays that are not enabled, which do not address local accounts and are not replies to accounts that do have local followers
2019-02-12Move sending account Delete to anyone but the account's followers to the ↵ThibG
pull̀ queue (#10016)
2019-02-06Fix Tombstone.delete_all ArgumentError (#9978)abcang
2019-02-04Add featured hashtags to profiles (#9755)Eugen Rochko
* Add hashtag filter to profiles GET /@:username/tagged/:hashtag GET /api/v1/accounts/:id/statuses?tagged=:hashtag * Display featured hashtags on public profile * Use separate model for featured tags * Update featured hashtag counters on-write * Limit featured tags to 10
2019-02-03Add option to overwrite imported data (#9962)Eugen Rochko
* Add option to overwrite imported data Fix #7465 * Add import for domain blocks
2019-02-02Create Redisable#redis (#9633)ysksn
* Create Redisable * Use #redis instead of Redis.current
2019-01-26Prevent posting toots with media attachments from someone else (#9921)ThibG
2019-01-24Rescue SSL error in verify link service (#9914)Renato "Lond" Cerqueira
If the first link to be verified contains a rel=me link with a SSL error, the VerifyAccountLinksWorker will fail and not try the following links. This rescues the SSL error when fetching the link, avoiding this issue.
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-19Fix error when `scheduled_at` attribute is malformed (#9866)Eugen Rochko
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-18Add tombstones for remote statuses (#9830)ThibG
* Add Tombstone model to remember object deletion * Do not recreate a status if it has been deleted * Record Tombstone for remote deleted items Also, only record deleted items from same-host actors * Clear an user's tombstones when their key change
2019-01-18Fix code style of regeneration-related code (#9843)Eugen Rochko
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-07Improvements to signature verification (#9667)ThibG
* Refactor signature verification a bit * Rescue signature verification if recorded public key is invalid Fixes #8822 * Always re-fetch AP signing key when HTTP Signature verification fails But when the account is not marked as stale, avoid fetching collections and media, and avoid webfinger round-trip. * Apply stoplight to key/account update as well as initial key retrieval
2019-01-07Add locale param to sign-up API (#9747)Eugen Rochko
Fix #9627