Commit Graph

2771 Commits (2338b5954c22ca683ee59610ac5d5d635d1c41c5)

Author SHA1 Message Date
ThibG 2338b5954c Thread toot notification mails by conversation (#5061)
* Thread toot notification mails by conversation

* Make codeclimate happy and avoid potential mis-threading
2017-09-24 11:19:42 +02:00
Daigo 3 Dango 7e6322863c Compact status_ids in StatusRelationshipsPresenter (#5073) 2017-09-24 11:18:32 +02:00
abcang 9cdd517849 Fix media spoiler of DetailedStatus (#5071) 2017-09-24 11:15:11 +02:00
Daigo 3 Dango e7624bfaae Suppress backtrace when failed to communicate with a remote instance (#5076) 2017-09-24 11:14:06 +02:00
Eugen Rochko 9ad1bfbc18 In detail status view, display attachment uncropped if there's only one (#5054)
* In detail status view, display attachment uncropped if there's only one

* Make media spoiler the size of the media it hides, enable on static
2017-09-24 05:58:30 +02:00
Eugen Rochko 40399df3e4 Make sure nil IDs to not get cast to empty string in REST API (#5068) 2017-09-24 04:09:32 +02:00
Eugen Rochko ba676acb6e Change mobile layout breakpoint from 1024px to 630px (#5063)
630px = Drawer + 1 Column
2017-09-24 01:25:07 +02:00
Eugen Rochko 6a42ddd01c Dropdown triangles a bit nicer, smoother scrolling on touch (#5062) 2017-09-24 00:40:10 +02:00
Eugen Rochko b8a3a45da1 Fix media gallery CSS (#5064) 2017-09-24 00:33:26 +02:00
Eugen Rochko 0468f86a8b Require at least 2 characters before showing autosuggestions (#5065) 2017-09-24 00:33:17 +02:00
Mingye Wang 213b828014 jsx/zh-*: Fix "pin column" for Chinese (#5060) 2017-09-23 22:47:15 +02:00
m4sk1n 6cf48c427b i18n: Update Polish translation (#5058) 2017-09-23 22:14:39 +02:00
Lynx Kotoura 2063f622df Fix overflowing tabs in account__action-bar (#5056)
* Fix numbers in accounts columns

* Support edge compact-header
2017-09-23 21:06:16 +02:00
Eugen Rochko da257754b5 Add emoji autosuggest (#5053)
* Add emoji autosuggest

Some credit goes to glitch-soc/mastodon#149

* Remove server-side shortcode->unicode conversion

* Insert shortcode when suggestion is custom emoji

* Remove remnant of server-side emojis

* Update style of autosuggestions

* Fix wrong emoji filenames generated in autosuggest item

* Do not lazy load emoji picker, as that no longer works

* Fix custom emoji autosuggest

* Fix multiple "Custom" categories getting added to emoji index, only add once
2017-09-23 14:47:32 +02:00
Eugen Rochko 4a0212bf2f Add custom emojis to the emoji picker (#5052) 2017-09-23 05:40:28 +02:00
Eugen Rochko f621e05356 New API: GET /api/v1/custom_emojis to get a server's custom emojis (#5051) 2017-09-23 01:57:23 +02:00
Eugen Rochko d2aeb45461 Fix custom emojis not detected when used in content warning (#5049) 2017-09-23 01:50:17 +02:00
Eugen Rochko 16a5d1450c Switch from EmojiOne to Twemoji, different emoji picker (#5046)
* Switch from EmojiOne to Twemoji, different emoji picker

* Make emoji-mart use a local spritesheet

* Fix emojify test

* yarn manage:translations
2017-09-23 01:41:00 +02:00
Akihiko Odaki f9dd41621f Do not filter statuses with unknown languages (#5045) 2017-09-22 19:33:17 +02:00
Nolan Lawson 60c22ed3ac Fix PropTypes.oneOfType() warning (#5041) 2017-09-22 17:50:29 +02:00
Eugen Rochko f7810f56a1 Make dropdowns render into portal, expand animation (#5018)
* Make dropdowns render into portal, expand animation

* Improve actions modal style
2017-09-22 04:59:17 +02:00
Nolan Lawson 9710fd0c63 Use passive listener in privacy_dropdown.js (#5037) 2017-09-22 04:59:01 +02:00
Nolan Lawson 4a48d03b31 Eliminate re-renders for intersection_observer_article.js (#5036) 2017-09-22 04:58:33 +02:00
syui 77090376ca fix : mobile style of /about/more (#5034) 2017-09-21 14:30:21 +02:00
MIYAGI Hikaru cc0b56b40e 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
2017-09-21 03:47:16 +02:00
Nolan Lawson e03dd027b5 Reduce wasted renders for column_loading.js (#5021)
* Reduce wasted renders for column_loading.js

* Use defaultProps
2017-09-20 19:58:44 +02:00
unarist ca502e7b15 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)
2017-09-20 19:07:23 +02:00
TomoyaShibata 28e4e7b4a0 Remove unnecessary css property (#5025) 2017-09-20 15:26:22 +02:00
aschmitz 618df7a5ee 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.
2017-09-20 14:53:48 +02:00
Eugen Rochko 4e4a803ee3 Fix custom emojis with non-1:1 aspect ratio being stretched (#5017) 2017-09-20 03:38:38 +02:00
MIYAGI Hikaru 1fa17e1a43 redo #4500 with customEmojis (#5016) 2017-09-19 23:27:29 +02:00
ThibG 0d9bc73158 Fix race condition when processing incoming OStatus messages (#5013)
* Avoid races in incoming OStatus toots processing

* oops

* oops again
2017-09-19 21:44:18 +02:00
Akihiko Odaki b1ba673029 Introduce OStatus::TagManager (#5008) 2017-09-19 18:08:08 +02:00
Naoki Kosaka 6b3e313022 Fix non-local statuses are html_encoded in public_page. (#5012) 2017-09-19 17:55:48 +02:00
Nolan Lawson 60bb0928a8 Set touchstart listener to 'passive', remove 'once' (#5011) 2017-09-19 17:00:29 +02:00
nullkal e5a634f940 Use OrderedCollectionPage to return followers/following list (#4949) 2017-09-19 16:37:06 +02:00
Andrew b4842ef0b9 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
2017-09-19 16:36:23 +02:00
unarist 57c5493d4e Hide sensitive image in default on the public pages (#5009)
Additionally, this restores previous background / text color for media spoiler.
2017-09-19 16:03:45 +02:00
Eugen Rochko 48377dfe46 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
2017-09-19 06:53:16 +02:00
Yamagishi Kazutoshi 3dde6679c2 Fix custom emojis index (#5006) 2017-09-19 05:06:13 +02:00
Eugen Rochko ef6defa2c4 Define emoji context for ActivityPub (#5004)
* Define emoji context for ActivityPub

* Fix the emojo

* Use general Mastodon context instead
2017-09-19 05:05:48 +02:00
Eugen Rochko e9bb7e62b1 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
2017-09-19 03:52:38 +02:00
Eugen Rochko eb345f8e8b 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
2017-09-19 02:42:40 +02:00
BruWalfas f4d0774877 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
2017-09-19 07:47:48 +09:00
Nolan Lawson 6c31ded9f7 Add will-change to improve scrolling perf (#5001) 2017-09-18 23:29:15 +02:00
unarist 938a99c89d 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.
2017-09-18 21:25:40 +02:00
unarist f4b3642767 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.
2017-09-18 20:30:11 +02:00
Yamagishi Kazutoshi a3d75ce672 Do not add image size without meta to OGP (regression from #4901) (#4995) 2017-09-18 15:00:29 +02:00
Akihiko Odaki f4e3449e61 Use Account.local.sum(statuses_count) instead of Status.local.count (#4996)
It is faster.
2017-09-18 14:59:57 +02:00
Yamagishi Kazutoshi 313d90b8f4 Add `strip_insignificant_zeros: true` option to `number_to_human` (#4993) 2017-09-18 04:55:23 +02:00