about summary refs log tree commit diff
path: root/app/lib
AgeCommit message (Collapse)Author
2017-05-19Unify the method of extracting tags (#3138)abcang
2017-05-19Conditional validations no longer accept strings for if/unless (#3124)Matt Jankowski
2017-05-19Account domain blocks (#2381)Eugen Rochko
* Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
2017-05-13Revert HTML CW changes (#3020)beatrix
* selectively Revert "Fix regressions from #2683 (#2970)" This reverts commit 72698bc3b49925a2b2955f32e5a562c1eecd729b. * Revert "Handle hashtags in spoiler_texts (partial fix for #699) (#2683)" This reverts commit e2491680e696d2c285a798ec4c66b26d2748df66.
2017-05-12Add conversation model, <ostatus:conversation /> (#3016)Eugen Rochko
* Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Fix conversation migration * More spec coverage for status before_create * Prevent n+1 query when generating Atom with the new conversations * Improve code style * Remove redundant local variable
2017-05-12Prepend reblogs' wrapper content with "RT @original_author", (#3013)Eugen Rochko
so that when a reblog parse fails on another instance, it doesn't look like a misattributed/stolen text
2017-05-12Fix not rejecting remote URIs when parsing out local IDs (#3012)Eugen Rochko
2017-05-11Fix #1426 - Trim long usernames in public follower/following lists (#2993)Eugen Rochko
Fix #2221 - Catch OpenSSL exceptions when loading remote avatars/headers/attachments Don't strip "rel" attribute from <a> tags when sanitizing (microformats)
2017-05-11When avatar/header are missing, do not include the missing file into Atom ↵Eugen Rochko
(#2988) Receiving instances will then use their own missing image Also, add <content /> to deleted statuses, since there was a reported problem with the deletes and GNU social
2017-05-11Fix regressions from #2683 (#2970)Eugen Rochko
* Fix regressions from #2683 Properly format spoiler text HTML, while keeping old logic for blankness intact Process hashtags and mentions in spoiler text Format spoiler text for Atom Change "show more" toggle into a button instead of anchor Fix style regression on dropdowns for detailed statuses * Fix lint issue * Convert spoiler text to plaintext in desktop notifications
2017-05-10fix a regression introduced by e2491680e696d2c285a798ec4c66b26d2748df66 (#2966)beatrix
that caused user pages to break when showing toots with CWs
2017-05-10Handle hashtags in spoiler_texts (partial fix for #699) (#2683)R Tucker
* services: scan spoiler_text for hashtags (#699) * views: link hashtags from spoiler_texts This covers linking hashtags from within the spoiler text on the server-generated pages. * services: fix string concat going into hashtag RE Cleaner Ruby syntax, may handle immutable strings better
2017-05-09Use CLD3 (#2949)Akihiko Odaki
Compact Language Detector v3 (CLD3) is the successor of CLD2, which was used in the previous implementation. CLD3 includes improvements since CLD2, and supports newer compilers. On the other hand, it has additional requirements and cld3-ruby, the FFI of CLD3 for Ruby, is still new and may be still inmature. Though CLD3 is named after CLD2, it is implemented with a neural network model, different from the old implementation, which is based on a Naïve Bayesian classifier. CLD3 supports newer compilers, such as GCC 6. CLD2 is not compatible with GCC 6 because it assigns negative values to varibales typed unsigned. (see internal/cld_generated_cjk_uni_prop_80.cc) The support for GCC 6 and newer compilers are essential today, when some server operating system such as Ubuntu Server 16.10 has GCC 6 by default. On the one hand, CLD3 requires C++11 support. Environments with old compilers such as Ubuntu Server 14.04 needs to update the system or install a newer compiler. CLD3 needs protocol buffers as a new dependency. However,it is not considered problematic because major server operating systems, CentOS and Ubuntu Server provide them. The FFI cld3-ruby was written by me (Akihiko Odaki) for use in Mastodon. It is still new and may be inmature, but confirmed to pass existing tests.
2017-05-09Fixed bug that timeline can not be displayed by InvalidURIError (#2947)abcang
2017-05-08Delegate Account#user_locale method and allow nil (#2927)Matt Jankowski
2017-05-07raise-when-oembed-not-found (#2882)masarakki
2017-05-06Optimize MuteService and AfterBlockService (#2836)alpaca-tc
2017-05-05use Twitter::Extractor for creating links (#2502)masarakki
2017-05-05More robust PuSH subscription refreshes (#2799)Eugen Rochko
* Fix #2473 - Use sidekiq scheduler to refresh PuSH subscriptions instead of cron Fix an issue where / in domain would raise exception in TagManager#normalize_domain PuSH subscriptions refresh done in a round-robin way to avoid hammering a single server's hub in sequence. Correct handling of failures/retries through Sidekiq (see also #2613). Optimize Account#with_followers scope. Also, since subscriptions are now delegated to Sidekiq jobs, an uncaught exception will not stop the entire refreshing operation halfway through Fix #2702 - Correct user agent header on outgoing http requests * Add test for SubscribeService * Extract #expiring_accounts into method * Make mastodon:push:refresh no-op * Queues are now defined in sidekiq.yml * Queues are now in sidekiq.yml
2017-05-03Language improvements, replace whatlanguage with CLD (#2753)Matt Jankowski
* add failing en specs * add cld2 gem * Replace WhatLanguage with CLD
2017-04-30Add target=_blank to user note (#2622)Yamagishi Kazutoshi
* Add target=_blank to user note Open new window when click link from user profile in remote instance. * fix rubocop
2017-04-27Hotfix remote status formatting (#2543)Eugen Rochko
2017-04-27Fix broken oEmbed provider (#2537)Yamagishi Kazutoshi
2017-04-27OEmbed support for PreviewCard (#2337)Eugen Rochko
* OEmbed support for PreviewCard * Improve ProviderDiscovery code failure treatment * Do not crawl links if there is a content warning, since those don't display a link card anyway * Reset db schema * Fresh migrate * Fix rubocop style issues Fix #1681 - return existing access token when applicable instead of creating new * Fix test * Extract http client to helper * Improve oembed controller
2017-04-25Decodes URL containing IDN (#2436)Yamagishi Kazutoshi
2017-04-25Punycode URI normalization (#2370)Eugen
* Fix #2119 - Whenever about to send a HTTP request, normalize the URI * Add test for IDN request in FetchLinkCardService * Perform IDN normalization on domains before they are stored in the DB
2017-04-23Add simple_format to simplified_format (#2198)178inaba
2017-04-23Allow webfinger controller to reply to user@WEB_DOMAIN in addition to ↵ThibG
user@LOCAL_DOMAIN (#2351) This provides a hotfix for outbound salmon requests to other Mastodon instances as they currently will try to resovle user@WEB_DOMAIN instead of user@LOCAL_DOMAIN (see #2012 and #20312). Furthermore, this should ease transition from users switching from LOCAL_DOMAIN = WEB_DOMAIN to another LOCAL_DOMAIN when WEB_DOMAIN does not change.
2017-04-22[WIP] Html lang on statuses (#2297)Matt Jankowski
* Add html lang attributes around statuses * Remove urls from language detection
2017-04-22Improve bio compatibility (#2278)Eugen
* Fix #1057 (close #1819) - Move HTML-formatted bio from <poco:note /> to <summary type="html" /> * Ensure <poco:note /> is plaintext for remote accounts, also, by stripping out HTML
2017-04-21Fix mangling of ##tag matches (#2194) (#2247)Mingye Wang
This commit fixes hashtag_html so it correctly handles matches with multiple hash-signs. Bug located by @over9001, initial fix suggested by @nightpool.
2017-04-21Clean up settings/preferences controller (#2237)Matt Jankowski
* Add missing fields group on preferences page * Clean up settings/preferences controller * Extract a UserSettingsDecorator
2017-04-19Fix html escape characters in the URL (#2138)abcang
* fix character escaping in URL * add tests * put a comma after the last item * add HTML escape test
2017-04-18Language detection refactor (#2099)Matt Jankowski
* Extract detect_language to separate class * Use default locale, not just en * Add spec to confirm that whatlanguage cant identify empty string * Allow account locale to override default in language detector * PostStatusService supplies an account to detect language
2017-04-17Fix #1972, fix #1870 - Fix special characters in XML, add tests (#1988)Eugen
Also improve efficiency of the mastodon:maintenance:add_static_avatars task
2017-04-16Fix #1870 - Strip control characters out of strings in AtomSerializer (#1876)Eugen
* Fix #1870 - Strip control characters out of strings in AtomSerializer * Adjust according to comment by @alpaca-tc
2017-04-16Add language detection (#1772)Eugen
* Add language detection via WhatLanguage and (de)serialization of it through Atom * Fix default language in ProcessFeedService * Re-add newline before 'react-rails' Gem to fix groupings Fixes Code Climate issue
2017-04-16Fix #1852 - Ensure feeds have valid <title> tags (#1875)Eugen
2017-04-15Allow running mastodon on a different domain as the one used for identifying ↵ThibG
users (#1267) * Allow running mastodon on a different domain as the one used for identifying users * Alter documentation of WEB_DOMAIN to make clear it shouldn't be used unless the admin knows what they are doing * Compare to web_domain instead of local_domain when dealing with feeds/API * Correctly identify mentions to local accounts Mentions URLs point to the person's web profile, i.e., the user page served on WEB_DOMAIN.
2017-04-14Change usage of gsub to delete, as per Code Climate/Rubocop recommendation ↵Effy Elden
(#1753)
2017-04-13Fix #1220, fix #1671 - Hook up comment box to the Redux comment value (#1699)Eugen
Fix username styling regression introduced in #1063 Fix report screen background regression introduced in #1415
2017-04-13Fix #1609, fix #1628 - Revert #1397 (#1700)Eugen
When transmitting data in a HTML-encoded element like <content type="html" />, relying on newlines being preserved is not wise, since HTML by itself does not care for newlines - it cares for <p> and <br> Additional fix: reset NSFW toggle after sending toot
2017-04-13Organize coverage dirs (#1695)Matt Jankowski
* Add `Presenters` group to SimpleCov configuration * Move validators to app/validators, add to simplecov config
2017-04-12significant improvement in microformats markup (#1063)Ben Roberts
* significant improvement in microformats markup This is a huge improvement and I believe will close #965. Had these microformats reviewed by others in the community to help ensure they are at least correct, if not complete. I did not want to change the structure of the page, and so there it does not fully mark up the entire ancestry chain, or reply chain, only the direct decendants and direct ancestors are correctly associated, but this is likely fine as the most important bit is to have access to the urls for those toots which are now correctly fetchable. * improve code climate * trying to pass code climate tests * code climate * fix p-summary for content warning posts * fix error introduced when merging via github
2017-04-12Quick best practice cleanup of views/helpers (#1546)Matt Jankowski
* Remove trailing whitespace * Use query methods instead of explicit .blank? checks
2017-04-12Webfinger resource to extract username from resource string (#1607)Matt Jankowski
* Add WebfingerResource class to extract usernames * Use WebfingerResource in xrd#webfinger
2017-04-11Remove order prior to .find_in_batches (#1470)Matt Jankowski
The `Status` class has a default order on it, so when this query gets built and gets all the way to `find_in_batches` there is an order already there. When `find_in_batches` is run it discards any existing order on the query, and emits a warning to the logs if there is one there. This change removes the order prior calling `find_in_batches`, which will stop the logged warning from occurring as well.
2017-04-10Clean up generation of account webfinger string (#1477)Matt Jankowski
* Consolidate webfinger string creation under Account#to_webfinger_s * Introduce Account#local_username_and_domain for consolidation
2017-04-10Keep newlines in xml (#1397)Rachel H
2017-04-09Fix #1339 - better Atom titles (#1343)Eugen