Commit Graph

2753 Commits (0de82dd316839ed329504bfbf9bd0f2d3d96e654)

Author SHA1 Message Date
Akihiko Odaki 0de82dd316 Do not filter statuses with unknown languages (#5045) 7 years ago
Nolan Lawson b01ab55ed8 Fix PropTypes.oneOfType() warning (#5041) 7 years ago
Eugen Rochko 034fab39ab Make dropdowns render into portal, expand animation (#5018)
* Make dropdowns render into portal, expand animation

* Improve actions modal style
7 years ago
Nolan Lawson 0df6442636 Use passive listener in privacy_dropdown.js (#5037) 7 years ago
Nolan Lawson 245816ab27 Eliminate re-renders for intersection_observer_article.js (#5036) 7 years ago
syui 63819c848d fix : mobile style of /about/more (#5034) 7 years ago
MIYAGI Hikaru a9abe89093 Fix shortname problem in emojify() (regression from #5016) (#5032)
When colon appears end of line, skiped all character containing unicode emojis. Fixed.
https://github.com/tootsuite/mastodon/pull/5016#issuecomment-331012008
7 years ago
Nolan Lawson 798b0fc5af Reduce wasted renders for column_loading.js (#5021)
* Reduce wasted renders for column_loading.js

* Use defaultProps
7 years ago
unarist c8580eb806 Use file extensions in addition to MIME types for file picker (#5029)
Currently we're using a list of MIME types for `accept` attribute on `input[type="file"]` for filter options of file picker, and actual file extensions will be infered by browsers. However, infered extensions may not include our expected items. For example, "image/jpeg" seems to be infered to
only ".jfif" extension in Firefox.

To ensure common file extensions are in the list, this PR adds file extensions in addition to MIME types. Also having items in both format is encouraged by HTML5 spec.

https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)
7 years ago
TomoyaShibata 8cb4561145 Remove unnecessary css property (#5025) 7 years ago
aschmitz 669fe9ee06 Change IDs to strings rather than numbers in API JSON output (#5019)
* Fix JavaScript interface with long IDs

Somewhat predictably, the JS interface handled IDs as numbers, which in
JS are IEEE double-precision floats. This loses some precision when
working with numbers as large as those generated by the new ID scheme,
so we instead handle them here as strings. This is relatively simple,
and doesn't appear to have caused any problems, but should definitely
be tested more thoroughly than the built-in tests. Several days of use
appear to support this working properly.

BREAKING CHANGE:

The major(!) change here is that IDs are now returned as strings by the
REST endpoints, rather than as integers. In practice, relatively few
changes were required to make the existing JS UI work with this change,
but it will likely hit API clients pretty hard: it's an entirely
different type to consume. (The one API client I tested, Tusky, handles
this with no problems, however.)

Twitter ran into this issue when introducing Snowflake IDs, and decided
to instead introduce an `id_str` field in JSON responses. I have opted
to *not* do that, and instead force all IDs to 64-bit integers
represented by strings in one go. (I believe Twitter exacerbated their
problem by rolling out the changes three times: once for statuses, once
for DMs, and once for user IDs, as well as by leaving an integer ID
value in JSON. As they said, "If you’re using the `id` field with JSON
in a Javascript-related language, there is a very high likelihood that
the integers will be silently munged by Javascript interpreters. In most
cases, this will result in behavior such as being unable to load or
delete a specific direct message, because the ID you're sending to the
API is different than the actual identifier associated with the
message." [1]) However, given that this is a significant change for API
users, alternatives or a transition time may be appropriate.

1: https://blog.twitter.com/developer/en_us/a/2011/direct-messages-going-snowflake-on-sep-30-2011.html

* Additional fixes for stringified IDs in JSON

These should be the last two. These were identified using eslint to try
to identify any plain casts to JavaScript numbers. (Some such casts are
legitimate, but these were not.)

Adding the following to .eslintrc.yml will identify casts to numbers:

~~~
  no-restricted-syntax:
  - warn
  - selector: UnaryExpression[operator='+'] > :not(Literal)
    message: Avoid the use of unary +
  - selector: CallExpression[callee.name='Number']
    message: Casting with Number() may coerce string IDs to numbers
~~~

The remaining three casts appear legitimate: two casts to array indices,
one in a server to turn an environment variable into a number.

* Back out RelationshipsController Change

This was made to make a test a bit less flakey, but has nothing to
do with this branch.

* Change internal streaming payloads to stringified IDs as well

Per
https://github.com/tootsuite/mastodon/pull/5019#issuecomment-330736452
we need these changes to send deleted status IDs as strings, not
integers.
7 years ago
Eugen Rochko b35406b700 Fix custom emojis with non-1:1 aspect ratio being stretched (#5017) 7 years ago
MIYAGI Hikaru 8e33fc29d7 redo #4500 with customEmojis (#5016) 7 years ago
ThibG 34fa305a00 Fix race condition when processing incoming OStatus messages (#5013)
* Avoid races in incoming OStatus toots processing

* oops

* oops again
7 years ago
Akihiko Odaki bb4d005a83 Introduce OStatus::TagManager (#5008) 7 years ago
Naoki Kosaka df1ce2350c Fix non-local statuses are html_encoded in public_page. (#5012) 7 years ago
Nolan Lawson e5c65b3067 Set touchstart listener to 'passive', remove 'once' (#5011) 7 years ago
nullkal 7d16bb379d Use OrderedCollectionPage to return followers/following list (#4949) 7 years ago
Andrew 0401a24558 Add support for multiple themes (#4959)
* Add support for selecting a theme

* Fix codeclimate issues

* Look up site default style if current user is not available due to e.g. not being logged in

* Remove outdated comment in common.js

* Address requested changes in themes PR

* Fix codeclimate issues

* Explicitly check current_account in application controller and only check theme availability if non-nil

* codeclimate

* explicit precedence with &&

* Fix code style in application_controller according to @nightpool's suggestion, use default style in embedded.html.haml

* codeclimate: indentation + return
7 years ago
unarist 4aea3f88a6 Hide sensitive image in default on the public pages (#5009)
Additionally, this restores previous background / text color for media spoiler.
7 years ago
Eugen Rochko 41e6c8b151 Fix incomplete account records being read (#4998)
* Fix incomplete account records being read

- Put account processing into redis lock
- Do not save until record is complete

* Fix spaces
7 years ago
Yamagishi Kazutoshi 1664e52cbb Fix custom emojis index (#5006) 7 years ago
Eugen Rochko dce869dfc7 Define emoji context for ActivityPub (#5004)
* Define emoji context for ActivityPub

* Fix the emojo

* Use general Mastodon context instead
7 years ago
Eugen Rochko 09a94b575e Admin interface for listing, adding and removing custom emojis (#5002)
* Admin interface for listing, adding and removing custom emojis

* Only display local ones in the list
7 years ago
Eugen Rochko 81cec35dbf Custom emoji (#4988)
* Custom emoji

- In OStatus: `<link rel="emoji" name="coolcat" href="http://..." />`
- In ActivityPub: `{ type: "Emoji", name: ":coolcat:", href: "http://..." }`
- In REST API: Status object includes `emojis` array (`shortcode`, `url`)
- Domain blocks with reject media stop emojis
- Emoji file up to 50KB
- Web UI handles custom emojis
- Static pages render custom emojis as `<img />` tags

Side effects:

- Undo #4500 optimization, as I needed to modify it to restore
  shortcode handling in emojify()
- Formatter#plaintext should now make sure stripped out line-breaks
  and paragraphs are replaced with newlines

* Fix emoji at the start not being converted
7 years ago
BruWalfas c155d843f4 A few updates to the Spanish translation and some typos fixing (#4997)
* So Spanish. Much changes. Wow.

* Some little fixes

* Updated es.yml, and fixed some ortographical errors

* Some little changes to simple_form.es.yml

* Yeah, so much translations

* Spanish e-mail messages

* Remove unused message
7 years ago
Nolan Lawson 3d640dc8ac Add will-change to improve scrolling perf (#5001) 7 years ago
unarist 6db034a866 Re-allow underscore on valid_url_path_ending_chars (#4999)
Limiting allowed characters in the last character of the URL is came from twitter-text, but underscore is allowed on there, and Mastodon before #4941.
7 years ago
unarist 17bf3363ac Add published property to ActivityPub activity for reblogs (#5000)
Since reblogs are serialized as Announce activity, its published property can be used for the creation time of reblog.
7 years ago
Yamagishi Kazutoshi dcf1139ebd Do not add image size without meta to OGP (regression from #4901) (#4995) 7 years ago
Akihiko Odaki 9619b7f727 Use Account.local.sum(statuses_count) instead of Status.local.count (#4996)
It is faster.
7 years ago
Yamagishi Kazutoshi 9e0985d9e4 Add `strip_insignificant_zeros: true` option to `number_to_human` (#4993) 7 years ago
febrezo cf14f4945a Some improvements in the Spanish translation (#4991) 7 years ago
Lynx Kotoura 4c14ff659b Oauth code in input form and add description message (#4986)
* Oauth code in a input form and add description

* New authcode description
7 years ago
unarist dd6f9a1b82 Validate uri presence for remote status (#4985) 7 years ago
unarist 3f07f1b2b1 Raise an error on getting activity uri for remote status (#4984)
We had returned `nil` for that case, but this raises an error instead, as a wrong usage of the method.
This method is currently only used in ActivitySerializer.
7 years ago
abcang 44245926f1 Fix cancellation of scroll to the right (#4978) 7 years ago
unarist 1eab53ee10 Fix an error when actor json couldn't be fetched in ResolveRemoteAccountService (#4979)
* Fix an error when actor json couldn't be fetched in ResolveRemoteAccountService

* Add specs
7 years ago
BruWalfas 7be3131240 So Spanish. Much changes. Wow. (#4976) 7 years ago
Akihiko Odaki 198a9a4fa4 Remove local_only scope in Status (#4977) 7 years ago
unarist ec36df97c4 Escape URL parts on formatting local status (#4975) 7 years ago
Mingye Wang c8969dca35 Minor Chinese check & jsx addition (#4973)
* zh-*: transition from "like" back to "fav"

This commit reverts the translation for the yellow-star "fav" button
back to "fav" in Chinese. Some ambuiguity between "like" and "fav" is
deliberately used in zh-TW/HK by using the existing phrase "最爱"
(favorite (adj.), lit. love-most) instead of "收藏" (favourite (v.),
"collect") in some instances.

Fixes #3511.

* zh-*: apply suggestions for PR #4557

* zh-cn: de-monetize ya account

In Chinese two separate characters, 账 and 帐, can be used to spell the
word for account (账/帐户). However, the one with a 贝 on the left is
evolved from the latter specifically for monetary purposes. Since
people usually can't figure out which one to use, it might be a good
idea to use the original not-so-money one.

* zh-*: complete jsx translation
7 years ago
Lynx Kotoura 1e3b1d7211 Adjust landing pages 2 (#4967)
* Adjust landing pages 2

Fix styles of terms page
Remove action buttons from timeline in about page
Adjust styles of short description
Adjust form inputs
Set autocomplete off for username and email box in registration form. Remove line breakings.

* Revert removing action buttons
7 years ago
unarist 0698c610a6 Fix an error in ReplyDistributionWorker when replied status was deleted (#4974)
Reply distribution is proceed by Sidekiq, so replied status may be deleted before this.
7 years ago
ふぁぼ原 629fae8b3b correct URL pattern used in text length counter in WebUI (#4968) 7 years ago
unarist c30e6433de Fix AP serialization error when thread is missing (#4970)
`Status#reply?` may returns true even if the thread is missing.
e.g. the replied status was deleted or couldn't be fetched.

Then it raises NoMethodError on various AP json serialization.

This issue won't happen on Atom serialization because it checks thread
existence using `StreamEntry#threaded?` instead.
7 years ago
Naoki Kosaka cea5597722 Fix hasSize condition in secSet and sizes. (#4969) 7 years ago
Akihiko Odaki 48d77ea1eb Fix filterable_languages method of SettingsHelper (#4966) 7 years ago
Eugen Rochko 54edb4b853 When accessing uncached media attachment, redownload it (#4955)
* When accessing uncached media attachment, redownload it

* Prevent re-download of rejected media
7 years ago
unarist 6c81f9d6e5 Fix invisible load more button (#4962)
* Fix behavior while the button is invisible
e.g. pointer cursor, couldn't open contextmenu
* Avoid rendering the button to remove blank space if no more items are available or no items are rendered
7 years ago