about summary refs log tree commit diff
path: root/app/services
AgeCommit message (Collapse)Author
2018-03-24Close http connection in perform method of Request class (#6889)Akihiko Odaki
HTTP connections must be explicitly closed in many cases, and letting perform method close connections makes its callers less redundant and prevent them from forgetting to close connections.
2018-03-20Use username/domain to match existing accounts in ActivityPub (#6842)Eugen Rochko
See also: #6837, #6667
2018-03-17Add entropy to download filenames (#6811)nightpool
pretty quick fix, and with the 1 week expiration i don't think we need to be too worried about the existing files closes #6798
2018-03-08For now, put a "." into no-text statuses with media for backcompat (#6691)Eugen Rochko
2018-03-08After blocking domain with reject_media, invalidate cache (#6679)Eugen Rochko
Media attachments are part of the association cache of statuses, since they are presumed to be immutable. Unless this cache is cleared manually, the statuses will continue to look like they have media embedded.
2018-03-07Remove text requirement when media attached from statuses (#6672)Eugen Rochko
2018-03-04Federate pinned statuses over ActivityPub (#6610)Eugen Rochko
* Federate pinned statuses over ActivityPub * Display pinned toots in web UI Fix #6117 * Fix migration * Fix tests * Update outbox_serializer.rb * Update remove_serializer.rb * Update add_serializer.rb * Update fetch_featured_collection_service.rb
2018-03-03Fix 500 while searching after deleting a post (#6604)Aboobacker MK
Fixes #6602
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-21Account archive download (#6460)Eugen Rochko
* Fix #201: Account archive download * Export actor and private key in the archive * Optimize BackupService - Add conversation to cached associations of status, because somehow it was forgotten and is source of N+1 queries - Explicitly call GC between batches of records being fetched (Model class allocations are the worst offender) - Stream media files into the tar in 1MB chunks (Do not allocate media file (up to 8MB) as string into memory) - Use #bytesize instead of #size to calculate file size for JSON (Fix FileOverflow error) - Segment media into subfolders by status ID because apparently GIF-to-MP4 media are all named "media.mp4" for some reason * Keep uniquely generated filename in Paperclip::GifTranscoder * Ensure dumped files do not overwrite each other by maintaing directory partitions * Give tar archives a good name * Add scheduler to remove week-old backups * Fix code style issue
2018-02-15Fix #5173: Click card to embed external content (#6471)Eugen Rochko
2018-02-09Full-text search for authorized statuses (#6423)Eugen Rochko
* Add full-text search for authorized statuses - Search API will return statuses that match the query - Only for logged in users - Only if you are author of the status, - Or you were mentioned in it - Or you favourited or reblogged it - Configuration over `ES_ENABLED`, `ES_HOST`, `ES_PORT`, `ES_PREFIX` - Run `rails chewy:deploy` to create & populate index Fix #5880 Fix #4293 Fix #1152 * Add commented out docker-compose configuration for ES container * Optimize index import, filter search results * Add basic normalization to the index * Add better stemming and normalization to the index * Skip webfinger request if search query includes both @ and a space * Fix code style * Visually separate search result sections * Fix code style issues
2018-02-02Fix saving of oEmbed image (#6409)abcang
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-17Fix home regeneration (#6251)Eugen Rochko
* Fix regeneration marker not being removed after completion * Return HTTP 206 from /api/v1/timelines/home if regeneration in progress Prioritize RegenerationWorker by putting it into default queue * Display loading indicator and poll home timeline while it regenerates * Add graphic to regeneration message * Make "not found" indicator consistent with home regeneration
2018-01-15Allow attributedTo in a status to be an embedded object (#6238)puckipedia
2018-01-08Fix bad URL schemes being accepted (#6219)Eugen Rochko
* 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
2018-01-05When fetching an ActivityPub-enabled status, do not re-request it as ↵ThibG
text/html (#6196)
2018-01-04Send one Delete of Actor in ActivityPub when account is suspended (#6172)Eugen Rochko
2018-01-04Fix FetchAtomService not finding alternatives if there's a Link header (#6170)Eugen Rochko
without them, such as is the case with GNU social Fixes the ability to find GNU social accounts via URL in search and when using remote follow function
2018-01-03Update moved-to property when it's removed too (#6160)Eugen Rochko
* Fix #6140 - Update moved-to property when it's removed too * Remove trailing whitespace
2017-12-22Reduce the number of synchronous resolves when posting toots (#6075)ThibG
2017-12-13Fix redundant HTTP request in FetchLinkCardService (#6002)Eugen Rochko
2017-12-13Fix #5952 - NameError (regression from #5762) (#5999)Eugen Rochko
* Fix #5952 - NameError (regression from #5762) * Fix
2017-12-12Store preview image for embedded photo in preview cards (#5986)Akihiko Odaki
The preview image would be useful to embed in timeline.
2017-12-12Return false if object does not respond to url (#5988)Renato "Lond" Cerqueira
Avoid error when the service returns a mostly valid oembed, but has no url in it, causing a MethodError: undefined method `url' for #<OEmbed::Response::Photo:0x000056505def9620>
2017-12-12Change conditional to avoid nil into string error in sidekiq (#5987)Renato "Lond" Cerqueira
* Change conditional to avoid nil into string error in sidekiq When obtaining information about users with mastodon in a different subdomain, sidekiq was giving out a 'no implicit conversion of nil into String' * Use presence instead of blank? with ternary. Following suggestion on PR
2017-12-10Fix account and tag searches with leading/trailing spaces (#5965)Andrea Scarpino
* Strip leading & trailing spaces from account query * Strip leading & trailing spaces from tag search
2017-12-09Ignore HEAD method if does not support (#5949)Yamagishi Kazutoshi
2017-12-09Fix #5926 - Do not downgrade to OStatus once ActivityPub is known (#5929)Eugen Rochko
2017-12-07Add embed_url to preview cards (#5775)Akihiko Odaki
2017-12-06Search only from followees (#5897)Yamagishi Kazutoshi
2017-12-06Using double splat operator (#5859)Yamagishi Kazutoshi
2017-12-05Add list of lists component to web UI (#5811)Eugen Rochko
* Add list of lists component to web UI * Add list adding * Add list removing * List editor modal * Add API account search limited by following=true relation * Rework list editor modal * Remove mandatory pagination of GET /api/v1/lists/:id/accounts * Adjust search input placeholder * Fix rspec (#5890) * i18n: (zh-CN) Add missing translations for #5811 (#5891) * i18n: (zh-CN) yarn manage:translations -- zh-CN * i18n: (zh-CN) Add missing translations for #5811 * Fix some issues - Display loading/missing state for list timelines - Order lists alphabetically in overview - Fix async list editor reset - Redirect to /lists after deleting unpinned list - Redirect to / after pinning a list * Remove dead list columns when a list is deleted or fetch returns 404
2017-11-30Add semi-support for Video/Image objects in ActivityPub (#5848)Eugen Rochko
* Add semi-support for Video/Image objects in ActivityPub Video and Image objects will create corresponding status records with manually crafted text contents (title + URL) * Extract html-url-finding logic into JsonLdHelper * Fallback to id when url missing, extract supported object types
2017-11-30Fix too many forwards (#5854)Eugen Rochko
* 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
2017-11-28Allow hiding of reblogs from followed users (#5762)aschmitz
* Allow hiding of reblogs from followed users This adds a new entry to the account menu to allow users to hide future reblogs from a user (and then if they've done that, to show future reblogs instead). This does not remove or add historical reblogs from/to the user's timeline; it only affects new statuses. The API for this operates by sending a "reblogs" key to the follow endpoint. If this is sent when starting a new follow, it will be respected from the beginning of the follow relationship (even if the follow request must be approved by the followee). If this is sent when a follow relationship already exists, it will simply update the existing follow relationship. As with the notification muting, this will now return an object ({reblogs: [true|false]}) or false for each follow relationship when requesting relationship information for an account. This should cause few issues due to an object being truthy in many languages, but some modifications may need to be made in pickier languages. Database changes: adds a show_reblogs column (default true, non-nullable) to the follows and follow_requests tables. Because these are non-nullable, we use the existing MigrationHelpers to perform this change without locking those tables, although the tables are likely to be small anyway. Tests included. See also <https://github.com/glitch-soc/mastodon/pull/212>. * Rubocop fixes * Code review changes * Test fixes This patchset closes #648 and resolves #3271. * Rubocop fix * Revert reblogs defaulting in argument, fix tests It turns out we needed this for the same reason we needed it in muting: if nil gets passed in somehow (most usually by an API client not passing any value), we need to detect and handle it. We could specify a default in the parameter and then also catch nil, but there's no great reason to duplicate the default value.
2017-11-28Fix handling of temporary failures in ProcessMentionsService (#5842)ThibG
* Add test for temporary account resolving failures in ProcessMentionsService * Fix processing of mentions to already-known remote accounts on temporary failures
2017-11-20Fixed duplicating URL of photo type of oEmbed (#5763)abcang
2017-11-19Fix NoMethodError at ActivityPub::FetchRemoteStatusService (#5753)abcang
2017-11-18Profile redirect notes (#5746)Eugen Rochko
* Serialize moved accounts into REST and ActivityPub APIs * Parse federated moved accounts from ActivityPub * Add note about moved accounts to public profiles * Add moved account message to web UI * Fix code style issues
2017-11-18Lists (#5703)Eugen Rochko
* Add structure for lists * Add list timeline streaming API * Add list APIs, bind list-account relation to follow relation * Add API for adding/removing accounts from lists * Add pagination to lists API * Add pagination to list accounts API * Adjust scopes for new APIs - Creating and modifying lists merely requires "write" scope - Fetching information about lists merely requires "read" scope * Add test for wrong user context on list timeline * Clean up tests
2017-11-17Fix some rubocop style issues (#5730)Eugen Rochko
2017-11-15Optional notification muting (#5087)Surinna Curtis
* Add a hide_notifications column to mutes * Add muting_notifications? and a notifications argument to mute! * block notifications in notify_service from hard muted accounts * Add specs for how mute! interacts with muting_notifications? * specs testing that hide_notifications in mutes actually hides notifications * Add support for muting notifications in MuteService * API support for muting notifications (and specs) * Less gross passing of notifications flag * Break out a separate mute modal with a hide-notifications checkbox. * Convert profile header mute to use mute modal * Satisfy eslint. * specs for MuteService notifications params * add trailing newlines to files for Pork :) * Put the label for the hide notifications checkbox in a label element. * Add a /api/v1/mutes/details route that just returns the array of mutes. * Define a serializer for /api/v1/mutes/details * Add more specs for the /api/v1/mutes/details endpoint * Expose whether a mute hides notifications in the api/v1/relationships endpoint * Show whether muted users' notifications are muted in account lists * Allow modifying the hide_notifications of a mute with the /api/v1/accounts/:id/mute endpoint * make the hide/unhide notifications buttons work * satisfy eslint * In probably dead code, replace a dispatch of muteAccount that was skipping the modal with launching the mute modal. * fix a missing import * add an explanatory comment to AccountInteractions * Refactor handling of default params for muting to make code cleaner * minor code style fixes oops * Fixed a typo that was breaking the account mute API endpoint * Apply white-space: nowrap to account relationships icons * Fix code style issues * Remove superfluous blank line * Rename /api/v1/mutes/details -> /api/v2/mutes * Don't serialize "account" in MuteSerializer Doing so is somewhat unnecessary since it's always the current user's account. * Fix wrong variable name in api/v2/mutes * Use Toggle in place of checkbox in the mute modal. * Make the Toggle in the mute modal look better * Code style changes in specs and removed an extra space * Code review suggestions from akihikodaki Also fixed a syntax error in tests for AccountInteractions. * Make AddHideNotificationsToMute Concurrent It's not clear how much this will benefit instances in practice, as the number of mutes tends to be pretty small, but this should prevent any blocking migrations nonetheless. * Fix up migration things * Remove /api/v2/mutes
2017-11-15Use already-known remote user data if resolving temporarily fails in ↵ThibG
mentions (#5702)
2017-11-14Add option to block direct messages from people you don't follow (#5669)Eugen Rochko
* Add option to block direct messages from people you don't follow Fix #5326 * If the DM responds to a toot by recipient, allow it through * i18n: Update Polish translation (for #5669) (#5673)
2017-11-07Fix process mentions for local users, as local users are considered to use ↵ThibG
OStatus (#5618)
2017-11-07Twidere mention workaround (#5552)ThibG
* Work around Twidere and Tootdon bug Tootdon and Twidere construct @user@domain handles from mentions in toots based solely on the mention text and account URI's domain without performing any webfinger call or retrieving account info from the Mastodon server. As a result, when a remote user has WEB_DOMAIN ≠ LOCAL_DOMAIN, Twidere and Tootdon will construct the mention as @user@WEB_DOMAIN. Now, this will usually resolve to the correct account (since the recommended configuration is to have WEB_DOMAIN perform webfinger redirections to LOCAL_DOMAIN) when processing mentions, but won't do so when displaying them (as it does not go through the whole account resolution at that time). This change rewrites mentions to the resolved account, so that displaying the mentions will work. * Use lookbehind instead of non-capturing group in MENTION_RE Indeed, substitutions with the previous regexp would erroneously eat any preceding whitespace, which would lead to concatenated mentions in the previous commit. Note that users will “lose” up to one character space per mention for their toots, as that regexp is also used to remove the domain-part of mentioned users for character counting purposes, and it also erroneously removed the preceding character if it was a space.