about summary refs log tree commit diff
path: root/app/lib
AgeCommit message (Collapse)Author
2018-02-28Fix #5708: Reject->Follow will remove the follow if it exists (#6571)Eugen Rochko
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-24Raise Mastodon::HostValidationError when host for HTTP request is private ↵Akihiko Odaki
(#6410)
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-22Focal points (#6520)Eugen Rochko
* Add focus param to media API, center thumbnails on focus point * Add UI for setting a focal point * Improve focal point icon on upload item * Use focal point in upload preview * Add focalPoint property to ActivityPub * Don't show focal point button for non-image attachments
2018-02-21Fix avatar and header issues by using custom geometry detector (#6515)Eugen Rochko
* Fix avatar and header issues by using custom geometry detector Revert a part of #6508. The file passed to dynamic styles method was not actually a file, but an instance of Paperclip::Attachment, which broke all styles by always returning {} from the method. One problem with GIF avatars was that Paperclip::GeometryDetector reported wrong dimensions for them, e.g. 120x120 GIF avatar would for some reason be detected as 120x53. By writing our own geometry parser, we can use FastImage, which also happens to be faster than ImageMagick, to detect image dimensions, which are also correct. Unfortunately, this PR does not implement skipping a `convert` entirely if the dimensions are already correct, as I found no easy way to write that behaviour into Paperclip without rewriting the Paperclip::Thumbnail class. * Only invoke convert if dimension or format needs to be changed
2018-02-17Push discovered status through streaming API within a time window (#6484)Eugen Rochko
Time window of 6 hours
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-09Add preference to always display sensitive media (#6448)Eugen Rochko
2018-02-02Accept ActivityPub announce from the author of the original note (#6236)Akihiko Odaki
2018-01-19Process mentions and reblogs even from resolved threads (#6299)ThibG
This may lead to out-of-order notifications, but this is better than not having notifications at all.
2018-01-09Skip ActivityPub Announces of non-public objects (#6230)Eugen Rochko
* Skip ActivityPub Announces of non-public objects * Skip OStatus reblogs of non-public statuses
2018-01-09Add the author of a status to cc if reblogged (#6226)puckipedia
This makes slightly more sense, and ensures that the author of a post is always referenced in the audience (which some servers might rely on). And the announce is POSTed to the author's inbox anyways.
2018-01-08Revert #5772 (#6221)Eugen Rochko
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-08Move Article from supported to converted types (#6218)puckipedia
2018-01-03Don't normalize URLs in toots (#6134)ThibG
* Don't normalize URLs in toots URL normalization is ill-defined and may cause certain links to break. * Change specs since we are not normalizing user-provided URLs
2018-01-03Allow to dereference Follow object for ActivityPub (#5772)Akihiko Odaki
* Allow to dereference Follow object for ActivityPub * Accept IRI as object representation for Accept activity
2018-01-03[!] Sanitize incoming classlist properly (#6162)puckipedia
* Sanitize classlist properly * Actually properly sanitize every class after the first * Improve Formatter spec to check for multiple classes and non-space whitespace
2018-01-03Don't leave behind husk of remotely-deleted profile (#6159)Eugen Rochko
There's no reason for an Account record to persist after Delete->Actor is received. SuspendAccountService is necessary to make sure deleted toots get sent over streaming API properly and home feeds get cleaned up. By removing Account record, we can ensure that if in the future the account is restored remotely (or username reused), it can start with a clean slate.
2018-01-02Fix stats expiring too quickly because of variable mistake (#6155)Eugen Rochko
2017-12-29Add more instance stats APIs (#6125)Eugen Rochko
* Add GET /api/v1/instance/peers API to reveal known domains * Add GET /api/v1/instance/activity API * Make new APIs disableable, exclude private statuses from activity stats * Fix code style issue * Fix week timestamps
2017-12-27Fix XML oEmbed support discovery (#6104)Akihiko Odaki
2017-12-15Do not hide statuses from silenced accounts from other silenced accounts (#6030)Eugen Rochko
2017-12-13Fix redundant HTTP request in FetchLinkCardService (#6002)Eugen Rochko
2017-12-10Save media outside transaction (#5959)abcang
2017-12-06Using double splat operator (#5859)Yamagishi Kazutoshi
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-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-16Improve language filter (#5724)Renato "Lond" Cerqueira
* Scrub text of html before detecting language. * Detect language on statuses coming from activitypub. * Fix rubocop comments. * Remove custom emoji from text before language detection
2017-11-07Avoid emojifying on invisible text (#5558)MIYAGI Hikaru
2017-10-27Allow ActivityPub Note's tag and attachment to be single objects (#5534)puckipedia
2017-10-17When status is fetched instead of delivered, do not stream it (#5437)Eugen Rochko
2017-10-17Clean up reblog tracking keys, related improvements (#5428)aschmitz
* Clean up reblog-tracking sets from FeedManager Builds on #5419, with a few minor optimizations and cleanup of sets after they are no longer needed. * Update tests, fix multiply-reblogged case Previously, we would have lost the fact that a given status was reblogged if the displayed reblog of it was removed, now we don't. Also added tests to make sure FeedManager#trim cleans up our reblog tracking keys, fixed up FeedCleanupScheduler to use the right loop, and fixed the test for it.
2017-10-16Keep references to all reblogs of a status on home feed (#5419)Eugen Rochko
* Keep references to all reblogs of a status on home feed When inserting reblog: Add to set of reblogs of this status on the feed, if original status was present in the feed, add it to that set as well. When removing a reblog: Remove it from that set. Take random remaining item from the set. If one exists, re-insert it into feed, otherwise do not re-insert anything. Fix #4210 * When original is removed, toss out reblog references
2017-10-16Ensure that feed renegeration restores non-zero items (#5409)Eugen Rochko
Fix #5398 Ordering the home timeline query by account_id meant that the first 100 items belonged to a single account. There was also no reason to reverse-iterate over the statuses. Assuming the user accesses the feed halfway-through, it's better to have recent statuses already available at the top. Therefore working from newer->older is ideal. If the algorithm ends up filtering all items out during last-mile filtering, repeat again a page further. The algorithm terminates when either at least one item has been added, or if the database query returns nothing (end of data reached)
2017-10-16Fix un-reblogged status being at wrong position in the home timeline (#5418)unarist
We've changed un-reblogging behavior when we implement Snowflake, to insert un-reblogged status at the position reblogging status existed. However, our API expects home timeline is ordered by status ids, and max_id/since_id filters by zset score. Due to this, un-reblogged status appears as a last item of result set, and timeline expansion may skips many statuses. So this reverts that change...reblogged status inserted at corresponding position to its id.
2017-10-16Add option to reduce motion (#5393)Nolan Lawson
* Add option to reduce motion * Use HOC to wrap all Motion calls * fix case-sensitive issue * Avoid updating too frequently * Get rid of unnecessary change to _simple_status.html.haml
2017-10-14Use atomUri in Undo activity of Announce (#5376)unarist
This allows deletion of reblogs which delivered before with OStatus URI.
2017-10-13Fix NameError: uninitialized constant OStatus::AtomSerializer::TagManager ↵Eugen Rochko
(#5371) This error occurred at least in development environment
2017-10-13Fix UserTrackingConcern firing on every request, optimize some queries (#5368)Eugen Rochko
- For some reason, :if option on before_action did not work. It got executed every time, returned false, and the action run anyway, which led to the current_sign_in_at and sign_in_count being updated on every request - Return "do not filter" early in FeedManager#filter_from_home? if the status is authored by receiver. Usually this method is not called for own statuses at all, but it is called when Feed#get uses the database - Return early if #reload_stale_associations! has nothing to load to save a database query with WHERE 1=0
2017-10-13When unfollowing, remove from home in web UI immediately (#5369)Eugen Rochko
Do NOT send "delete" through streaming API when unmerging from home timeline. "delete" implies that the original status was deleted, which is not true!
2017-10-08Fix #5271 - Fix missing attribute in remove_from_feed (#5277)Eugen Rochko
Regression from #4801
2017-10-08Set snowflake IDs for backdated statuses (#5260)Eugen Rochko
- Rename Mastodon::TimestampIds into Mastodon::Snowflake for clarity - Skip for statuses coming from inbox, aka delivered in real-time - Skip for statuses that claim to be from the future
2017-10-07Encode custom emojis as resolveable objects in ActivityPub (#5243)Eugen Rochko
* Encode custom emojis as resolveable objects in ActivityPub * Improve code style
2017-10-06Fix remote profile being displayed in HTML on remote_follow (#5249)unarist