Commit Graph

120 Commits (1899cf5f04400f8055e45ceda941a9580b93fa1e)

Author SHA1 Message Date
Yamagishi Kazutoshi 4a5f73c8ae Add target=_blank to user note (#2622)
* Add target=_blank to user note

Open new window when click link from user profile in remote instance.

* fix rubocop
8 years ago
Eugen Rochko 7406404fa3 Hotfix remote status formatting (#2543) 8 years ago
Yamagishi Kazutoshi 831ff60698 Fix broken oEmbed provider (#2537) 8 years ago
Eugen Rochko 88725d6ce8 OEmbed support for PreviewCard (#2337)
* 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
8 years ago
Yamagishi Kazutoshi 3ea5b948a4 Decodes URL containing IDN (#2436) 8 years ago
Eugen 17c591ffba Punycode URI normalization (#2370)
* 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
8 years ago
178inaba 1244630ab4 Add simple_format to simplified_format (#2198) 8 years ago
ThibG 89dc29affb Allow webfinger controller to reply to user@WEB_DOMAIN in addition to 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.
8 years ago
Matt Jankowski 629d35e6f5 [WIP] Html lang on statuses (#2297)
* Add html lang attributes around statuses

* Remove urls from language detection
8 years ago
Eugen 9d3be5579a Improve bio compatibility (#2278)
* 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
8 years ago
Mingye Wang 5c9aa2b732 Fix mangling of ##tag matches (#2194) (#2247)
This commit fixes hashtag_html so it correctly handles matches with multiple hash-signs.

Bug located by @over9001, initial fix suggested by @nightpool.
8 years ago
Matt Jankowski 2dda356e3f Clean up settings/preferences controller (#2237)
* Add missing fields group on preferences page

* Clean up settings/preferences controller

* Extract a UserSettingsDecorator
8 years ago
abcang 70891a99a9 Fix html escape characters in the URL (#2138)
* fix character escaping in URL

* add tests

* put a comma after the last item

* add HTML escape test
8 years ago
Matt Jankowski 297c11dba2 Language detection refactor (#2099)
* 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
8 years ago
Eugen 15ec4ae07b Fix #1972, fix #1870 - Fix special characters in XML, add tests (#1988)
Also improve efficiency of the mastodon:maintenance:add_static_avatars task
8 years ago
Eugen f902a335f9 Fix #1870 - Strip control characters out of strings in AtomSerializer (#1876)
* Fix #1870 - Strip control characters out of strings in AtomSerializer

* Adjust according to comment by @alpaca-tc
8 years ago
Eugen e4af4898de Add language detection (#1772)
* 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
8 years ago
Eugen 95bcbaa434 Fix #1852 - Ensure feeds have valid <title> tags (#1875) 8 years ago
ThibG a9529d3b4b Allow running mastodon on a different domain as the one used for identifying 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.
8 years ago
Effy Elden 8321884eef Change usage of gsub to delete, as per Code Climate/Rubocop recommendation (#1753) 8 years ago
Eugen ac54da9394 Fix #1220, fix #1671 - Hook up comment box to the Redux comment value (#1699)
Fix username styling regression introduced in #1063
Fix report screen background regression introduced in #1415
8 years ago
Eugen 043862f411 Fix #1609, fix #1628 - Revert #1397 (#1700)
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
8 years ago
Matt Jankowski b330d1f000 Organize coverage dirs (#1695)
* Add `Presenters` group to SimpleCov configuration

* Move validators to app/validators, add to simplecov config
8 years ago
Ben Roberts 0254ee9795 significant improvement in microformats markup (#1063)
* 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
8 years ago
Matt Jankowski c44a700252 Quick best practice cleanup of views/helpers (#1546)
* Remove trailing whitespace

* Use query methods instead of explicit .blank? checks
8 years ago
Matt Jankowski aa90798386 Webfinger resource to extract username from resource string (#1607)
* Add WebfingerResource class to extract usernames

* Use WebfingerResource in xrd#webfinger
8 years ago
Matt Jankowski b57eed4584 Remove order prior to .find_in_batches (#1470)
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.
8 years ago
Matt Jankowski 0687ab8ae3 Clean up generation of account webfinger string (#1477)
* Consolidate webfinger string creation under Account#to_webfinger_s

* Introduce Account#local_username_and_domain for consolidation
8 years ago
Rachel H f690320fb9 Keep newlines in xml (#1397) 8 years ago
Eugen c172919745 Fix #1339 - better Atom titles (#1343) 8 years ago
Joël Quenneville d4c94fa004 DRY up reblog vs original status check
Checking reblog vs original status was happening in multiple places
across the app. For views, this logic was encapsulated in a helper
method named `proper_status` but in the other layers of the app, the
logic was duplicated.

Because the logic is used at all layers of the app, we extracted it into
a `Status#proper` method on the model and changed all uses of the logic
to use this method. There is now a single source of truth for this
condition.

We added test coverage to untested methods that got refactored.
8 years ago
Eugen Rochko 8a6d8de60a Fix nil#object_type error 8 years ago
Eugen Rochko 624a9a7136 Re-add forgotten <author> element on standalone <entry> 8 years ago
Eugen 1c351709bc Force UTF8 encoding on generated XML (#1140) 8 years ago
Eugen 6d6a429af8 Rewrite Atom generation from stream entries to use Ox instead of Nokogiri (#1124)
* Rewrite Atom generation from stream entries to use Ox instead of Nokogiri::Builder

StreamEntry is now limited to only statuses, which allows some optimization. Removed
extra queries on AccountsController#show. AtomSerializer instead of AtomBuilderHelper
used in AccountsController#show, StreamEntriesController#show, StreamEntryRenderer
and PubSubHubbub::DistributionWorker

PubSubHubbub::DistributionWorker moves n+1 DomainBlock query to PubSubHubbub::DeliveryWorker
instead.

All Salmon slaps that aren't based on StreamEntry still use AtomBuilderHelper and Nokogiri

* All Salmon slaps now use Ox instead of Nokogiri. No touch from status on account
8 years ago
Eugen Rochko 5b95be1c42 Replace calls to FeedManager#inline_render and #broadcast 8 years ago
Kurtis Rainbolt-Greene 7bed4e51db Moved to the worker 8 years ago
Kurtis Rainbolt-Greene dc5704b0b0 This method isn't used anymore 8 years ago
Kurtis Rainbolt-Greene 1e96ce378e By pushing this into a worker we can reduce the amount of time the feed manager using workers eat up a connection 8 years ago
Eugen 117b22e905 Merge pull request #852 from peterkeen/email-whitelist-817
[#817] Add email whitelist
8 years ago
Eugen 2edeb3fe1c Merge pull request #858 from krainboltgreene/patch-6
Use active record shorthand
8 years ago
Eugen Rochko 6fd865c000 Spawn FeedInsertWorker to deliver status into personal feed 8 years ago
Kurtis Rainbolt-Greene 731e650681 Use active record shorthand 8 years ago
Pete Keen e9a6da6bc7 [#817] Add email whitelist
This adds the ability to filter user signup with a whitelist
instead of or in addition to a blacklist.

Fixes #817
8 years ago
Eugen Rochko 82aaedec46 Reduce number of items in feeds, optimize regeneration worker slightly,
make regeneration worker unique, (only schedule/execute once at a time)
8 years ago
Eugen Rochko b1f3499c38 Optimize FeedManager#unmerge, and slightly optimize FeedManager#merge 8 years ago
Eugen Rochko ce9df2fa82 Optimize filter methods in FeedManager a bit, use redis pipelining on merge/unmerge feed methods,
do not re-create a dynamic class on each feed push call, make sure redis-rb uses hiredis
8 years ago
Eugen Rochko 8232f76c48 Add check for visibility.nil? even though it can't ever be, to check for race conditions 8 years ago
Eugen Rochko d6b965cf08 Fix issue with feed merge-in code as well 8 years ago
Eugen Rochko 139fc994e2 Fix #408 - link @ names in bios 8 years ago