Commit Graph

3517 Commits

Author SHA1 Message Date
ThibG
5d5c0f4f43 Twidere mention workaround (#5552)
* Work around Twidere and Tootdon bug

Tootdon and Twidere construct @user@domain handles from mentions in toots based
solely on the mention text and account URI's domain without performing any
webfinger call or retrieving account info from the Mastodon server.

As a result, when a remote user has WEB_DOMAIN ≠ LOCAL_DOMAIN, Twidere and
Tootdon will construct the mention as @user@WEB_DOMAIN. Now, this will usually
resolve to the correct account (since the recommended configuration is to have
WEB_DOMAIN perform webfinger redirections to LOCAL_DOMAIN) when processing
mentions, but won't do so when displaying them (as it does not go through the
whole account resolution at that time).

This change rewrites mentions to the resolved account, so that displaying the
mentions will work.

* Use lookbehind instead of non-capturing group in MENTION_RE

Indeed, substitutions with the previous regexp would erroneously eat any
preceding whitespace, which would lead to concatenated mentions in the
previous commit.

Note that users will “lose” up to one character space per mention for their
toots, as that regexp is also used to remove the domain-part of mentioned
users for character counting purposes, and it also erroneously removed the
preceding character if it was a space.
2017-11-07 19:08:14 +01:00
Eugen Rochko
1032f3994f
Add ability to disable login and mark accounts as memorial (#5615)
Fix #5597
2017-11-07 19:06:44 +01:00
voidSatisfaction
e618edf85a fix: slang to adequate word (#5453) 2017-11-07 14:49:50 +01:00
nullkal
b6e2e999bd Show the local couterpart of emoji when it exists in /admin/custom_emojis (#5467)
* Show the local couterpart of emoji when it exists in admin/custom_emojis

* Fix indentation

* Fix error

* Add class table-action-link to Overwrite link

* Make it enable to overwrite emojis

* Make Code Climate happy
2017-11-07 14:49:32 +01:00
MIYAGI Hikaru
782224c991 Avoid emojifying on invisible text (#5558) 2017-11-07 14:48:13 +01:00
ThibG
84cfee2488 Do not process undeliverable mentions (#5598)
* Resolve remote accounts when mentioned even if they are already known

This commit reduces the risk of not having up-to-date public key or protocol
information for a remote account, which is required to deliver toots
(especially direct messages).

* Do not add mentions in private messages for remote users we cannot deliver to

Mastodon does not deliver private and direct toots to OStatus users, as there
is no guarantee the remote software understands the toot's privacy. However,
users currently do not get any feedback on it (Mastodon won't attempt delivery,
but the toot will be displayed exactly the same way to the user).

This change introduces *some* feedback by not processing mentions that are
not going to be delivered. A long-term solution is still needed to have
delivery receipts or at least some better indication of what is going on, but
at least an user can see *something* is up.
2017-11-07 14:47:39 +01:00
ThibG
7bea1530f4 Resolve remote accounts when mentioned even if they are already known (#5539)
This commit reduces the risk of not having up-to-date public key or protocol
information for a remote account, which is required to deliver toots
(especially direct messages).
2017-11-07 14:31:57 +01:00
nullkal
864c4d869f Make fullscreen video in detailed status plays in fullscreen (Partly Fix #5160) (#5611)
* Make fullscreen video in detailed status plays in fullscreen (Fix #5160)

* Directly assign the initial state
2017-11-07 14:24:55 +01:00
kedama
d8cd9000d9 Hide disabled custom emojis from emoji picker and emoji auto suggestions. (#5613)
Make the same behavior as /api/v1/custom_emojis.
2017-11-07 14:24:21 +01:00
kibigo!
bc8532359b Mastodon GO! -> v0.1.1 2017-11-06 20:00:03 -08:00
kibigo!
e0298d66f8 Autocollapse boosts option 2017-11-05 15:05:12 -08:00
MIYAGI Hikaru
8abe9e9058 don't display any descendants of .invisible (#5567)
* don't display any descendants of .invisible

* reduce the scope of selector

* remove some rules for image

* lint
2017-11-05 13:05:50 +01:00
beatrix
73bf0ea7d1
Merge pull request #204 from glitch-soc/with-mastodon-go
Introducing: Mastodon GO!
2017-11-04 09:14:08 -04:00
kibigo!
276432790a Introducing: Mastodon GO! 2017-11-04 05:48:42 -07:00
Quenty31
da3adc0a73 l10n Occitan (#5586)
* Update OC: time format

Correction for time format according to: https://opinion.jornalet.com/conselh-linguistic-de-jornalet/blog/2379/la-notacion-oraria-en-occitan
Harmonisation words in menu and confirmation windows

* Update for unlisted custum emoji + #5577

* correction subjonctiu

It's either siasque or siague

* Corrections

Any : qual que, in two words, else it means "some".
And "siasque" with S even if I don't pronounce it at all.

* Update oc.json
2017-11-03 17:42:30 +09:00
MitarashiDango
38d072446b add account search condition (instance domain) (#5577) 2017-11-01 14:46:05 +01:00
Sorin Davidoi
5521e94e24 refactor(features/ui): Avoid useless renders in WrappedSwitch (#5580) 2017-11-01 12:17:53 +01:00
Yamagishi Kazutoshi
763a2f8511
Replace react-router-scroll to react-router-scroll-4 (#5568) 2017-11-01 06:58:38 +09:00
Nolan Lawson
60f962eedc Refactor initial state: auto_play_gif (#5576) 2017-11-01 06:58:07 +09:00
Nolan Lawson
0692991b54 Add ServiceWorker caching for static assets (#5524) 2017-10-31 12:25:51 +01:00
Nolan Lawson
b254e6ca5f Refactor initial state: "me" (#5563)
* Refactor initial state: "me"

* remove "me" from reducers/meta.js
2017-10-31 11:27:48 +09:00
SerCom_KC
29609fbb6a Updating Chinese (Simplified) translations (#5508)
* i18n: (zh-CN) fix punctuations and spaces
Spaces are fixed according to https://github.com/sparanoid/chinese-copywriting-guidelines

* i18n: (zh-CN) fix punctuation

* i18n: (zh-CN) Adapt official translation of Discourse Privacy Policy from GitHub, with minor fixes
https://github.com/discourse/discourse/blob/master/config/locales/server.zh_CN.yml#L2677

* i18n: (zh-CN) Update missing translations

* i18n: (zh-CN) Fixing errors

* i18n: (zh-CN) Fix indent error

* i18n: (zh-CN) Fix language tag

* i18n: (zh-CN) Remove quotes

* i18n: (zh-CN) Update translation (#5485)

* i18n: (zh-CN) Remove whitespaces, x -> ×

* i18n: (zh-CN) Rewording on time distance

* i18n: (zh-CN) Overall improvements

* i18n: (zh-CN) i18n-tasks normalization

* i18n: (zh-CN) Add missing translation
2017-10-30 12:34:58 +09:00
ThibG
d37a56c07c Update remote ActivityPub users when fetching their toots (#5545) 2017-10-30 00:24:16 +09:00
Nolan Lawson
2cea4592a3 Avoid modifying emoji data inline (#5548) 2017-10-30 00:23:38 +09:00
Nolan Lawson
512feab222 Add margin to account for Edge disappearing scrollbar (#5522)
* Add margin to account for Edge disappearing scrollbar

* Fix 16px margin for DMs and horizontal line
2017-10-30 00:11:32 +09:00
Nolan Lawson
5e111ce16d Reactor unfollow_modal, boost_modal, delete_modal (#5505) 2017-10-30 00:10:15 +09:00
Herbert Kagumba
3e9236b343 Separate Follow/Unfollow and back buttons (#5496) 2017-10-27 19:14:11 +02:00
ThibG
89c77fe225 Instantiate service classes for each call (fixes #5540) (#5543) 2017-10-27 19:08:30 +02:00
Nolan Lawson
e843f62f47 Avoid unnecessary Motion components in icon_button.js (#5544) 2017-10-27 19:08:07 +02:00
Nolan Lawson
ec487166db Directly use <Motion/> if not reducing motion (#5546) 2017-10-27 19:06:54 +02:00
Nolan Lawson
3de22a82bf Refactor initial state: reduce_motion and auto_play_gif (#5501) 2017-10-28 00:04:44 +09:00
David Yip
870d71b78b Merge branch 'master' into gs-master 2017-10-27 09:45:25 -05:00
nullkal
781105293c Feature: Unlisted custom emojis (#5485) 2017-10-27 16:11:30 +02:00
puckipedia
0cb329f63a Allow ActivityPub Note's tag and attachment to be single objects (#5534) 2017-10-27 16:10:36 +02:00
Andrew
2827f852c0 Theme: Windows 95 2017-10-26 23:22:48 -07:00
Jenkins
656f5b6f87 Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master 2017-10-26 15:08:34 +00:00
erin
22da775a85 Fix copying emojos: redirect to the page you were on (#5509) 2017-10-26 23:44:24 +09:00
David Yip
dd28b94cf0 Merge remote-tracking branch 'origin/master' into gs-master 2017-10-26 09:18:27 -05:00
りんすき
d556be2968 Fix column design broken with very long title (#5493)
* Fix #5314

* fix not beautiful code

* fix broken design with mobile view

* remove no longer needed code
2017-10-26 22:52:48 +09:00
Nolan Lawson
02f7f3619a Remove translateZ(0) on modal overlay (#5478) 2017-10-26 22:46:50 +09:00
beatrix
a2612d0d38 Merge pull request #179 from glitch-soc/keyword-mute
Keyword muting
2017-10-25 17:37:48 -04:00
David Yip
42f2045c21 Merge remote-tracking branch 'STJrInuyasha/feature/direct-timeline' into gs-direct-timeline 2017-10-25 16:01:20 -05:00
Jenkins
5f0268ab84 Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master 2017-10-25 16:17:14 +00:00
Ratmir Karabut
20fee786b1 Update Russian translation (#5517)
* Add Russian translation (ru)

* Fix a missing comma

* Fix the wording for better consistency

* Update Russian translation

* Arrange Russian setting alphabetically

* Fix syntax error

* Update Russian translation

* Fix formatting error

* Update Russian translation

* Update Russian translation

* Update ru.jsx

* Fix syntax error

* Remove two_factor_auth.warning (appears obsolete)

* Add missing strings in ru.yml

A lot of new strings translated, especially for the newly added admin section

* Fix translation consistency

* Update Russian translation

* Update Russian translation (pluralizations)

* Update Russian translation

* Update Russian translation

* Update Russian translation (pin)

* Update Russian translation (account deletion)

* Fix extra line

* Update Russian translation (sessions)

* Update Russian translation

* Update Russian translation

* Fix merge conflicts (revert)

* Update Russian translation

* Update Russian translation (fix)

* Update Russian translation (fix quotes)

* Update Russian translation (fix quotes)

* Update Russian translation (fix)

* Update Russian translation

* Add quotes

* bundle exec i18n-tasks normalize
2017-10-26 00:21:58 +09:00
Olivier Nicole
1ba3725473 Complete Esperanto translation (#5520) 2017-10-25 22:38:37 +09:00
David Yip
e40fe4092d Remove nil check in Glitch::KeywordMute#=~.
@regex can no longer be nil, so we don't need to check it.
2017-10-24 19:03:59 -05:00
David Yip
d9485e6497 Assume Glitch::KeywordMute#destroy! works and error out if it doesn't.
There's nothing useful we can display if the destroy action messes up,
so might as well assert it does and complain loudly if it doesn't.
2017-10-24 18:56:57 -05:00
David Yip
d5c8ebe205 Use edit template for displaying errors in update. 2017-10-24 18:56:44 -05:00
David Yip
d03b48cea0 Also filter notifications containing muted keywords. 2017-10-24 18:51:27 -05:00
David Yip
9226257a1b Override Action View name inference in settings/keyword_mutes.
Glitch::KeywordMute's name is inferred as glitch_keyword_mutes, and in
templates this turns into e.g. settings/glitch/keyword_mutes.  Going
along with this convention means a lot of file movement, though, and for
a UI that's as temporary and awkward as this one I think it's less
effort to slap a bunch of as: options everywhere.

We'll do the Right Thing when we build out the API and frontend UI.
2017-10-24 18:40:28 -05:00
David Yip
f5a3283976 Switch to Regexp.union for building the mute expression.
Also make the keyword-building methods private: they always probably
should have been private, but now I have encoded enough fun and games
into them that it now seems wrong for them to *not* be private.
2017-10-24 18:31:34 -05:00
Ondřej Hruška
516eeeb43d option to add title to <Button>, use for toot buttons (#197) 2017-10-24 19:08:07 +02:00
David Yip
8410d33b49 Only cache the regex text, not the regex itself.
It is possible to cache a Regexp object, but I'm not sure what happens
if e.g. that object remains in cache across two different Ruby versions.
Caching a string seems to raise fewer questions.
2017-10-23 19:31:59 -05:00
David Yip
4f01e6e8d5 Merge remote-tracking branch 'origin/master' into gs-master 2017-10-22 22:57:41 -05:00
Matthew Walsh
a76b024228 Changes to match other timelines in 2.0 2017-10-22 18:45:35 -07:00
Matthew Walsh
3db80f75a6 Added a timeline for Direct statuses
* Lists all Direct statuses you've sent and received
* Displayed in Getting Started
* Streaming server support for direct TL
2017-10-22 18:35:14 -07:00
David Yip
af8f06413e KeywordMute matcher: more closely mimic Regexp#=~ behavior.
Regexp#=~ returns nil if it does not match.  An empty mute set does not
match any status, so KeywordMute::Matcher#=~ ought to return nil also.
2017-10-22 01:12:21 -05:00
David Yip
1a60445a5f Address unused translation errors. 2017-10-22 01:05:56 -05:00
David Yip
4c84513e04 Use current_account from ApplicationController.
This avoids copy-pasting definitions of set_account.
2017-10-22 01:02:52 -05:00
David Yip
4b68e82a19 Don't add \b to whole-word keywords that don't start with word characters.
Ditto for ending with \b.

Consider muting the phrase "(hot take)".  I stipulate it is reasonable
to enter this with the default "match whole word" behavior.  Under the
old behavior, this would be encoded as

    \b\(hot\ take\)\b

However, if \b is before the first character in the string and the first
character in the string is not a word character, then the match will
fail.  Ditto for after.  In our example, "(" is not a word character, so
this will not match statuses containing "(hot take)", and that's a very
surprising behavior.

To address this, we only add leading and trailing \b to keywords that
start or end with word characters.
2017-10-22 00:38:54 -05:00
David Yip
19826774f0 keyword mutes: also check spoiler (CW) text and reblogged statuses. 2017-10-22 00:38:53 -05:00
Marcin Mikołajczak
fdb0848e08 i18n: Update Polish Translation (#5494) 2017-10-22 08:34:39 +09:00
David Yip
ad86c86fa8 Apply keyword mutes to reblogs. 2017-10-21 15:44:47 -05:00
David Yip
670e6a33f8 Move KeywordMute into Glitch namespace.
There are two motivations for this:

1. It looks like we're going to add other features that require
   server-side storage (e.g. user notes).

2. Namespacing glitchsoc modifications is a good idea anyway: even if we
   do not end up doing (1), if upstream introduces a keyword-mute feature
   that also uses a "KeywordMute" model, we can avoid some merge
   conflicts this way and work on the more interesting task of
   choosing which implementation to use.
2017-10-21 14:54:36 -05:00
David Yip
cd04e3df58 Fill in create, edit, update, and destroy for keyword mutes interface.
Also add a destroy-all action, which can be useful if you're flushing an
old list entirely to start a new one.
2017-10-21 14:54:36 -05:00
David Yip
4a64181461 Allow keywords to match either substrings or whole words.
Word-boundary matching only works as intended in English and languages
that use similar word-breaking characters; it doesn't work so well in
(say) Japanese, Chinese, or Thai.  It's unacceptable to have a feature
that doesn't work as intended for some languages.  (Moreso especially
considering that it's likely that the largest contingent on the Mastodon
bit of the fediverse speaks Japanese.)

There are rules specified in Unicode TR29[1] for word-breaking across
all languages supported by Unicode, but the rules deliberately do not
cover all cases.  In fact, TR29 states

    For example, reliable detection of word boundaries in languages such
    as Thai, Lao, Chinese, or Japanese requires the use of dictionary
    lookup, analogous to English hyphenation.

So we aren't going to be able to make word detection work with regexes
within Mastodon (or glitchsoc).  However, for a first pass (even if it's
kind of punting) we can allow the user to choose whether they want word
or substring detection and warn about the limitations of this
implementation in, say, docs.

[1]: https://unicode.org/reports/tr29/
     https://web.archive.org/web/20171001005125/https://unicode.org/reports/tr29/
2017-10-21 14:54:36 -05:00
David Yip
2e03a10059 Spike out index and new views for keyword mutes controller. 2017-10-21 14:54:36 -05:00
David Yip
4fa2f7e82d Set up /settings/keyword_mutes. #164.
This should eventually be accessible via the API and the web frontend,
but I find it easier to set up an editing interface using Rails
templates and the like.  We can always take it out if it turns out we
don't need it.
2017-10-21 14:54:36 -05:00
David Yip
b4b657eb1d Invalidate cached matcher objects on KeywordMute commit. #164. 2017-10-21 14:54:36 -05:00
David Yip
693c66dfde Use more idiomatic string concatentation. #164.
The intent of the previous concatenation was to minimize object
allocations, which can end up being a slow killer.  However, it turns
out that under MRI 2.4.x, the shove-strings-in-an-array-and-join method
is not only arguably more common but (in this particular case) actually
allocates *fewer* objects than the string concatenation.

Or, at least, that's what I gather by running this:

    words = %w(palmettoes nudged hibernation bullish stockade's tightened Hades
    Dixie's formalize superego's commissaries Zappa's viceroy's apothecaries
    tablespoonful's barons Chennai tollgate ticked expands)

    a = Account.first

    KeywordMute.transaction do
      words.each { |w| KeywordMute.create!(keyword: w, account: a) }

      GC.start

      s1 = GC.stat

      re = String.new.tap do |str|
        scoped = KeywordMute.where(account: a)
        keywords = scoped.select(:id, :keyword)
        count = scoped.count

        keywords.find_each.with_index do |kw, index|
          str << Regexp.escape(kw.keyword.strip)
          str << '|' if index < count - 1
        end
      end

      s2 = GC.stat

      puts s1.inspect, s2.inspect

      raise ActiveRecord::Rollback
    end

vs this:

    words = %w( palmettoes nudged hibernation bullish stockade's tightened Hades Dixie's
    formalize superego's commissaries Zappa's viceroy's apothecaries tablespoonful's
    barons Chennai tollgate ticked expands
    )

    a = Account.first

    KeywordMute.transaction do
      words.each { |w| KeywordMute.create!(keyword: w, account: a) }

      GC.start

      s1 = GC.stat

      re = [].tap do |arr|
        KeywordMute.where(account: a).select(:keyword, :id).find_each do |m|
          arr << Regexp.escape(m.keyword.strip)
        end
      end.join('|')

      s2 = GC.stat

      puts s1.inspect, s2.inspect

      raise ActiveRecord::Rollback
    end

Using rails r, here is a comparison of the total_allocated_objects and
malloc_increase_bytes GC stat data:

                 total_allocated_objects        malloc_increase_bytes
string concat    3200241 -> 3201428 (+1187)     1176 -> 45216 (44040)
array join       3200380 -> 3201299 (+919)      1176 -> 36448 (35272)
2017-10-21 14:54:36 -05:00
David Yip
a4851100fd Make use of the regex attr_reader. #164.
It would also have been valid to get rid of the attr_reader, but I like
being able to reach inside KeywordMute::Matcher without resorting to
instance_variable_get tomfoolery.
2017-10-21 14:54:36 -05:00
David Yip
603cf02b70 Rework KeywordMute interface to use a matcher object; spec out matcher. #164.
A matcher object that builds a match from KeywordMute data and runs it
over text is, in my view, one of the easier ways to write examples for
this sort of thing.
2017-10-21 14:54:36 -05:00
David Yip
4745d6eeca Spec out KeywordMute interface. #164. 2017-10-21 14:54:21 -05:00
David Yip
9093e2de7a Add KeywordMute model.
Gist of the proposed keyword mute implementation:

Keyword mutes are represented server-side as one keyword per record.
For each account, there exists a keyword regex that is generated as one
big alternation of all keywords.  This regex is cached (in Redis, I
guess) so we can quickly get it when filtering in FeedManager.
2017-10-21 14:53:41 -05:00
Ondřej Hruška
d589dd7cd0 Compose buttons bar redesign + generalize dropdown (#194)
* Generalize compose dropdown for re-use

* wip stuffs

* new tootbox look and removed old doodle button files

* use the house icon for ...
2017-10-21 20:24:53 +02:00
beatrix
a7be86e875 hide mentions of muted accounts (in home col) (#190)
* hide mentions of muted accounts (in home col)

also cleans up some old crap

* add test
2017-10-20 10:49:54 -04:00
kibigo!
21bafc6555 Updates to bio metadata script 2017-10-19 16:11:53 -07:00
Nolan Lawson
8392ddbf87 Remove unnecessary translateZ(0) when doing scale() (#5473) 2017-10-19 18:27:55 +02:00
David Yip
9423553e5c Make the compose area optionally scrollable.
On desktop, the compose text box grows to accommodate the content.  On
mobile, the text box does not grow to accommodate text context, but does
grow to accommodate images.  It is possible in both cases to overflow
the available area, which makes accessing other UI elements (e.g.
visibility setttings) difficult.

This commit makes the compose area optionally scrollable, which allows
those UI elements to remain available even if they go off-screen.
2017-10-19 10:59:50 -05:00
David Yip
90770f6d59 Merge pull request #185 from glitch-soc/fix-null-status
workaround for null status
2017-10-18 17:01:31 -05:00
Ondřej Hruška
eb907a5bab
formatting fix for eslint 2017-10-18 23:44:06 +02:00
David Yip
39c9cdf7fe Remove unused filesAttached property. 2017-10-18 13:20:45 -05:00
David Yip
86cf4468af Update stylesheet imports in glitch components.
Commit 6e54719474 moved the Mastodon
variables and mixins deeper in the directory hierarchy; this commit
brings the glitch components in line with that change.
2017-10-18 11:52:34 -05:00
David Yip
42e8c8eb0e Merge tag 'v2.0.0' into gs-master 2017-10-18 11:52:04 -05:00
Sho Kusano
09d81defcd Suppress type error(not a function) on calling fastSeek (#5452) 2017-10-18 17:13:51 +02:00
Renato "Lond" Cerqueira
26b2a6a71e Fix pt-BR translation strings related to advanced search. (#5449) 2017-10-18 13:53:17 +02:00
Technowix
edf9a5e4fc Revert #5438 for FR (#5450)
As said here https://github.com/tootsuite/mastodon/pull/5438 the point of shortening the timestamp is legit, and after some time of adaptation no mistakes can be mades.
2017-10-18 13:51:30 +02:00
Håkan Eriksson
c710069c12 Some typos and supplementation in sentence structures (#5441)
* Swedish file added

* Swedish file added

* Swedish file updated

* Swedish languagefile added

* Add Swedish translation

* Add Swedish translation

* Started the Swedish translation

* Added Swedish lang settings

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Swedish language completed and added

* Swedish language Simple_form added

* Swedish language Divise added

* Swedish language doorkeeper added

* Swedish language - now all file complete

* Swedish - Typos and supplementation in sentence structure

* Update simple_form.sv.yml

* Update sv.yml

* Update sv.yml

Rearranged the alphabetical order.
2017-10-18 13:50:52 +02:00
JohnD28
e7099d8d9e fr.json typo (realtive time) (#5447)
Typo correction : https://fr.wikipedia.org/wiki/Heure#Typographie
2017-10-18 16:47:14 +09:00
YaQ
6e54719474 Make theme directory and Rename application.scss (#5336)
* Rename application.scss

* Move to 'default' directory

* Follow review

Move directory, and Rename "mastodon".

* Revert rename

* undo removal of newline
2017-10-18 05:20:07 +09:00
Eugen Rochko
f3003417c5 When unreblog arrives over streaming API, just delete in UI (#5439) 2017-10-17 22:17:02 +02:00
JeanGauthier
33ea042dec i18n better wording (OC/CA/FR) + string added in FR (#5438)
* Update oc.json

* Update fr.json

* Update ca.json

* Update fr.json

* Update simple_form.fr.yml

* Update ca.json

* Update fr.json

* Update oc.json

* Update oc.json

* Update fr.json
2017-10-17 21:49:39 +02:00
Nolan Lawson
8b22a63ab0 Fix scrolling of dropdown when offscreen (#5434) 2017-10-17 20:38:16 +02:00
Eugen Rochko
05686cc99d Fix unwanted content warning gap in CSS (#5436)
Fix #5356
2017-10-17 20:07:44 +02:00
Eugen Rochko
484208ce12 When status is fetched instead of delivered, do not stream it (#5437) 2017-10-17 20:05:21 +02:00
unarist
3bc8924940 Don't capture scheme-less URLs in the status (#5435)
Specifically, this fixes status length calculation to be same as JS side.

BTW, since this pattern used in not only preview card fetching, we
should extract it (with twitter-regex?) and write tests I think.
2017-10-17 18:32:25 +02:00
JeanGauthier
a02de9e012 i18n update (#5427) in OC/CA/FR/ES (#5431)
* Update oc.json

* Update ca.json

* Update fr.json

* Update es.json
2017-10-17 13:03:28 +02:00
unarist
2d395324e1 Fix React warning about tabIndex on status with CW (#5432) 2017-10-17 13:03:12 +02:00
Jakob Kramer
e6c9756fa9 Update German translation (#5425) 2017-10-17 12:02:47 +02:00
Yamagishi Kazutoshi
5050719fac Add Japanese translations (#5427)
* yarn manage:translations

* Add Japanese translation for #5410

* Add Japanese translation for #5393
2017-10-17 11:47:05 +02:00
aschmitz
554c2fd8af Clean up reblog tracking keys, related improvements (#5428)
* 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-17 11:45:06 +02:00
Håkan Eriksson
a2b600428c Swedish translation (#5406)
* Swedish file added

* Swedish file added

* Swedish file updated

* Swedish languagefile added

* Add Swedish translation

* Add Swedish translation

* Started the Swedish translation

* Added Swedish lang settings

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Updating Swedish language

* Swedish language completed and added

* Swedish language Simple_form added

* Swedish language Divise added

* Swedish language doorkeeper added

* Swedish language - now all file complete
2017-10-17 13:41:36 +09:00
Jeroen
df1a9c5ab5 Small update Dutch (nl) strings (#5424)
* Update Dutch strings

* Update Dutch
2017-10-17 01:00:23 +02:00
Ondřej Hruška
4421f6598f
Fix dual toot button wrong behavior after compose re-design 2017-10-16 23:32:13 +02:00
Ondřej Hruška
64a5e9a1de
workaround for null status 2017-10-16 23:09:39 +02:00
beatrix
7364b26e4b Merge pull request #184 from tootsuite/master
Fix reduced motion breaking public galleries (#5423)
2017-10-16 17:05:42 -04:00
David Yip
313ba202ef Merge pull request #182 from glitch-soc/wide-tootbox-panel
Full-width tootbox panel to make room for buttons
2017-10-16 15:49:22 -05:00
Ondřej Hruška
37ff061d9b
satisfy eslint and jest 2017-10-16 22:24:44 +02:00
Ondřej Hruška
3d7de06db4
rem a comment 2017-10-16 22:12:38 +02:00
Ondřej Hruška
26f08f0791
double-decker tootbox 2017-10-16 22:10:14 +02:00
Ondřej Hruška
8b9ee5f16b
Merge remote-tracking branch 'upstream/master' into upstream-merge-again 2017-10-16 21:13:47 +02:00
Ondřej Hruška
4b397adb5b
fix some lint errors 2017-10-16 21:13:34 +02:00
Nolan Lawson
8980aa804f Fix reduced motion breaking public galleries (#5423) 2017-10-16 21:08:01 +02:00
Eugen Rochko
34118169ac Keep references to all reblogs of a status on home feed (#5419)
* 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-16 20:44:31 +02:00
David Yip
7e9d93472c Merge remote-tracking branch 'upstream/master' into gs-master 2017-10-16 09:27:01 -05:00
David Yip
dbb1fce94d Merge remote-tracking branch 'upstream/master' into gs-master 2017-10-16 09:23:59 -05:00
Eugen Rochko
7cc71748ce Ensure that feed renegeration restores non-zero items (#5409)
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-16 16:08:51 +02:00
Eugen Rochko
aec70b44fc Filter out duplicate IDs in timelines reducer (#5417)
Possibly the cause of #5379, #5377
2017-10-16 15:59:30 +02:00
unarist
6f490b4bfe Fix un-reblogged status being at wrong position in the home timeline (#5418)
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-16 15:58:23 +02:00
voidSatisfaction
03975dbde4 Add up-to-date korean translation on client (#5402)
* chore: add Korean translation for client

* fix: change unlisted and embed Korean words
2017-10-16 14:39:28 +02:00
KY
f72936b4e6 Fix #5082 - disable retweet link for followers only toot (#5397)
* Fix #5082 - disable retweet link for followers only toot

* Hide reblog count when it is a direct message
2017-10-16 14:10:12 +02:00
Marcin Mikołajczak
3c530d95f6 i18n: Update Polish translation (#5416)
Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
2017-10-16 14:09:51 +02:00
JeanGauthier
1e7b3bf625 i18n ultim hour «More» dropdown title + reduce motion (#5415)
* Correction fem. form

* More dropdown title

* More dropdown title

* More dropdown title

* Add option to reduce motion (#5393)
2017-10-16 14:09:26 +02:00
Yamagishi Kazutoshi
bf0ee1a25c Enable ESLint rules import/* (#5414)
* Enable ESLint rules import/*

* fix
2017-10-16 11:12:09 +02:00
Nolan Lawson
fa0be3f834 Add option to reduce motion (#5393)
* 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-16 09:36:15 +02:00
Nolan Lawson
981e20b03a Fix offline-plugin warning in dev mode (#5411) 2017-10-16 09:33:50 +02:00
Yamagishi Kazutoshi
d5b767c374 Replace JavaScript Testing Framework from Mocha to Jest (#5412) 2017-10-16 09:33:08 +02:00
Nolan Lawson
93b54b8d4b i18n "More" dropdown title (#5410) 2017-10-16 09:31:47 +02:00
Nolan Lawson
e7ab9bf8b4 Refactor and simplify icon_button.js (#5413) 2017-10-16 09:30:09 +02:00
David Yip
6cd5b3bbe5 Merge remote-tracking branch 'origin/master' into gs-master 2017-10-16 01:29:02 -05:00
David Yip
f72ad67a39 Merge pull request #180 from STJrInuyasha/glitch-soc/avatar-unification
Avatar unification, mk.II
2017-10-16 00:49:05 -05:00
Matthew Walsh
56094cb4bd 1.6 changed files for unified avatar styling -- updated to restore unity 2017-10-15 21:14:21 -07:00
David Yip
22df18e902 Merge pull request #173 from glitch-soc/zerowidthmoji
use zerowidth spaces with emojis
2017-10-15 20:04:19 -05:00
Eugen Rochko
894da3dcca Clear timer when unmounting RelativeTimestamp components (#5408)
Possibly the cause of #5379, #5377
2017-10-16 03:03:36 +02:00
JeanGauthier
8eb7d30a6c l10n Occitan: finishing touches (#5404)
* Update oc.json

* Update oc.yml
2017-10-15 23:07:32 +02:00
Yannick A
7fe1428cc4 Update French translation (#5401) 2017-10-15 21:21:05 +09:00
Lynx Kotoura
b3b4b5a2eb Adjust public hashtag pages (#5357) 2017-10-14 14:48:12 +02:00
unarist
8125fdc19f Use atomUri in Undo activity of Announce (#5376)
This allows deletion of reblogs which delivered before with OStatus URI.
2017-10-14 14:42:09 +02:00
Ondřej Hruška
ae716a12e1 replace newlines in desktop notif with spaces instead of removing them (#5361) 2017-10-14 14:41:12 +02:00
spla
f63a40e7c2 Updated Catalan strings (#5323)
* Add Catalan language

* Add Catalan language

* Update ca.json

* Update ca.json

* Update ca.json

* Update ca.json

* Update ca.json

* Update ca.json

* Update settings_helper.rb

* Update mastodon.js

* Update index.js

* Update application.rb

* Update ca.yml

* removed extra spaces at line 225

* Catalan translation update

added activerecord.ca.yml

* Update activerecord.ca.yml

Done

* Updated activerecord.ca.yml

* Catalan language updated

* Catalan language updated

* Catalan language updated

* Catalan language updated

* Catalan language updated

* Update ca.json

Removed :

<<<<<<< HEAD
  "getting_started.support": "{faq} • {userguide} • {apps}",
=======
>>>>>>> upstream/master

* Syncing to master

* Added new Catalan strings

* removed config.secret_key line

* Corrected <sotrong> tag to <strong>

Line 515

* Removed extra line

* Reverted

* yarn.lock reverted

* Updated Catalan strings

* Updated Catalan strings
2017-10-14 14:40:35 +02:00
KY
1bdd694a0a Fix #5351 - Redirection with page params after copy emoji (#5387)
* Fix #5351 - Redirection with page params after copy emoji

* Add page params to copy emoji link
2017-10-14 14:40:10 +02:00
abcang
2eab41cd1a Close connection when succeeded posting (#5390)
* Close connection when succeeded posting

* Update webmock
2017-10-14 14:38:57 +02:00
Yannick A
c6f76db2e1 Update French translation (#5384)
Update French translation
2017-10-14 14:30:19 +02:00
Masoud Abkenar
2c704ca9c6 l10n: update Persian translation for 2.0 (#5391) 2017-10-14 14:28:19 +02:00
Ondřej Hruška
cdc22d23b9 Doodle improvements 2 (#176)
* Fix some doodle bugs and added Background color functionality

* added protections against accidental doodle erase, screen size changing

* resolve react warning about 'selected' on <option>
2017-10-14 12:24:35 +02:00
Jakob Kramer
eb96aa86a4 Update German translation (#5389) 2017-10-14 19:00:23 +09:00
Ondřej Hruška
531dadad86 Doodle palette, options, fill tool (#172) 2017-10-14 00:58:38 +02:00
Ondřej Hruška
723890b6fa
use zerowidth spaces for emojis 2017-10-14 00:48:53 +02:00
Ondřej Hruška
2af964ef20
Fixed a bug where the canvas would get transparent bg upon erase 2017-10-13 18:13:00 +02:00
Ondřej Hruška
33e806217f
Initial doodle support 2017-10-13 18:07:01 +02:00
Jeroen
c35132a738 Dutch strings: small change (#5375)
* Dutch strings: small change

* And this too.
2017-10-13 18:03:56 +02:00
unarist
a1c54220e8 Optimize Status#permitted_for 500x (account timeline) (#5373)
The main change of this PR is removing `order by visibility` hack.

This was introduced to force using of `index_statuses_on_account_id` instead of PK index, but it seems no longer needed probably due to `index_statuses_on_account_id_id`. Removing this avoids reading all rows, so really improves first fetching of the user who has lot of statuses.

I have also changed JOIN to IN + subquery, which slightly faster in most cases.
2017-10-13 16:53:43 +02:00
Eugen Rochko
df7dbc41ae Fix NameError: uninitialized constant OStatus::AtomSerializer::TagManager (#5371)
This error occurred at least in development environment
2017-10-13 16:44:43 +02:00
Eugen Rochko
b8db386e05 Fix UserTrackingConcern firing on every request, optimize some queries (#5368)
- 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-13 16:44:29 +02:00
Eugen Rochko
48f7a58799 Do not try to guess why home timeline is empty in web UI (#5370)
* Do not try to guess why home timeline is empty in web UI

* Fix style issue
2017-10-13 16:44:16 +02:00
Eugen Rochko
388d093beb When unfollowing, remove from home in web UI immediately (#5369)
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-13 16:44:02 +02:00
ThibG
95fe20b78a Fix remote status fetching for “pure” ActivityPub WEB_ACCOUNT users (#5372)
Remote ActivityPub users that have never been known as OStatus users
(whether or not they support it) will not have a “remote_url” attribute
set. In case they reside on an instance with WEB_DOMAIN ≠ LOCAL_DOMAIN,
the current check did rely on “remote_url” to verify the user's domain.
2017-10-13 12:58:13 +02:00
Yamagishi Kazutoshi
dc91fd482a Set InstancePresenter to Auth::RegistrationsController#create (#5366) 2017-10-13 09:35:07 +02:00
Lex Alexander
b8bae96647 Retoot count increases without reason (#5363)
* Retoot count increases without reason

-The store_uri method for Statuses was being called on after_create and causing reblogs to be incremented twice.
-This calls it when the transaction is finished by using after_create_commit.
-Fixes #4916.

* Added test case for after_create_commit callback for checking reblog count.

* Rewrote test to keep original, but added one for only the after_create_commit callback.
2017-10-13 02:52:09 +02:00
ThibG
d37305c628 Reduce discrepancies between server and client-side character count (#5360) 2017-10-12 23:26:34 +02:00
Anna e só
ad917cda10 l10n: PT-BR translation updated (#5362)
* PT-BR translation updated

* Testing

* Indentation error fixed

* More indentation errors fixed
2017-10-13 06:16:43 +09:00
Ondřej Hruška
df626fdd43
Fix the notification bug with newlines 2017-10-12 21:28:17 +02:00
David Yip
6a2b1ba91e Another tabs-vs-spaces fix, but with ~feeling~ 2017-10-12 09:36:26 -05:00
Alda Marteau-Hardi
3cfcc7a50e Fix some consistance errors in gender neutral formulations. Add some missing ones. (#5350) 2017-10-12 16:31:14 +02:00
David Yip
fe1c20cfb9 Fix tabs-vs-spaces issue pointed out by eslint. 2017-10-12 09:23:06 -05:00
JeanGauthier
cb7ba23cd8 Update oc.json (#5343) 2017-10-12 15:40:45 +02:00
unarist
35ec1c91e3 Fix some failure cases on FetchLinkCardService (#5347)
* If OEmbed response doesn't have a required property `type`, ignore it.
  e.g. `NoMethodError: undefined method 'type' for ...`
* If we failed to detect encoding, fallback to default behavior of Nokogiri.
  e.g. `KeyError: key not found: :encoding`
2017-10-12 12:01:32 +02:00
David Yip
edd1a00faf Restore variable assignment in MuteService#call.
291feba6f1 made MuteService return the
result of Account#mute!; this commit restores that behavior.
2017-10-12 04:27:45 -05:00
David Yip
13e05fece2 Merge tag 'v2.0.0rc2' into gs-master 2017-10-12 04:22:59 -05:00
Sylvhem
3ebe03b729 Fixes and updates for the French translation (#5340)
* Ajout du support des thèmes multiples

Ajoute des traductions pour les nouvelles chaînes permettant le support de thèmes multiples.

Add translations for the new strings allowing support for multiple themes.

* Mise à jour de la traduction

Met à jour les chaînes modifiées et ajoute des traductions pour celle n’en ayant pas.

Update modified strings and add new translations for the ones who are missing them.

* Remplace « ' » par « ’ »

Retire de la traduction les apostrophes droites « ' » (U+0027) au profit des apostrophes typographiques « ’ » (U+2019).
En typographie française, les apostrophes typographiques sont utilisées à la place des apostrophes droites. La traduction était incohérente et utilisait les deux.

Remove from the translation all the vertical apostrophes (U+0027) in favor of the curly ones (U+2019).
In French typography, typographic apostrophes are used instead of vertical ones. The translation was incoherent and used both.
2017-10-12 00:58:01 +02:00
Ondřej Hruška
eeaa8fba43
Fix our media gallery not having alt text and tooltips 2017-10-11 22:02:24 +02:00
Ondřej Hruška
b0b5ff1b0f
workaround for scrollIntoView bug ??? 2017-10-11 21:49:22 +02:00
Ondřej Hruška
bd51a16150
add duck beaks in haml 2017-10-11 21:34:00 +02:00
Ondřej Hruška
0bf9261e65
Merge remote-tracking branch 'upstream/master' 2017-10-11 21:27:17 +02:00
Jeroen
6bc07d3de3 Updating Dutch strings for 2.0 (#5334) 2017-10-11 21:21:22 +02:00
Alda Marteau-Hardi
0352c40e99 Use gender neutral language as in the rest of the french translation (#5331) 2017-10-11 21:20:56 +02:00
Lynx Kotoura
07ea625cb2 Fix styles of error pages (#5335)
Signed-off-by: Lynx Kotoura <admin@sanin.link>

Signed-off-by: Lynx Kotoura <admin@sanin.link>
2017-10-11 21:18:45 +02:00
kibigo!
3cc6255a7e Removed length check which now happens in reducer 2017-10-11 11:50:11 -07:00
kibigo!
35e2cad4eb Fixed header emojification 2017-10-11 11:00:28 -07:00
kibigo!
8d6b9ba494 Merge upstream 2.0ish #165 2017-10-11 10:43:10 -07:00
takayamaki
27101f1beb fix presented og:url is incorrect (#5320) 2017-10-11 19:22:21 +02:00
Eugen Rochko
1823cf435a In thread view, only scroll first update, scroll to replied-to post (#5322) 2017-10-11 19:21:44 +02:00
Nolan Lawson
6a50329a9c Only preload JS in /web pages (#5325) 2017-10-11 19:20:55 +02:00
Eugen Rochko
476e79b8e3 Fully disable hotkeys when input element is focused (#5324)
Because alt+n is a way to enter some kinda letter on some keyboard
2017-10-11 16:31:07 +02:00
JohnD28
19d3317a69 Update french translation : mastodon/locales/fr.json (#5318)
* Update fr.json

* Update fr.json

* Update fr.json
2017-10-11 22:07:09 +09:00
ButterflyOfFire
38600b2792 Update ar.json (#5316)
Pushing new arabic translated strings for Mastodon web client.
2017-10-11 21:19:04 +09:00
unarist
b0407ece42 Fix an error when ancestors get loaded before the status itself (#5312)
When ancestors get loaded, we scroll to the target status (i.e. skip
ancestors). However, ancestors may get loaded before the status itself,
then it causes TypeError because `this.node` is undefined yet.

Since we don't show anything until the status gets loaded, we don't need
to scroll to the target status in this time. If we get the status itslef
later, it causes `componentDidUpdate` and scrolling correctly.
2017-10-11 11:25:15 +02:00
Eugen Rochko
b3d7ad958f Fix #5306: Stop hotkeys in input fields even when shift is pressed (#5309)
AZERTY layouts require pressing shift to press a number at all, so
it triggers a column switch even when simply typing numbers in
textarea
2017-10-11 01:01:17 +02:00
takayamaki
552d22bec9 sign_in and sign_up views present og meta infos (#5308) 2017-10-11 00:52:25 +02:00
Eugen Rochko
9815be2a44 Fix #5293 - Pre-fill frequently used emojis to avoid bugs (#5305) 2017-10-10 20:47:14 +02:00
Eugen Rochko
61d3ecc805 Fix custom emoji copy not copying file (#5298) 2017-10-10 15:18:27 +02:00
Eugen Rochko
4bb3e4eeba Fix #5295 - Order custom emoji lexicographically (#5297) 2017-10-10 15:18:12 +02:00
unarist
784c7510d7 Fix an error when video playback buffer is empty (#5300) 2017-10-10 15:17:53 +02:00
nullkal
6c54d2e583 foreign_key, non-nullable, dependent: destroy in account_moderation_notes (#5294)
* Add foreign key constraint to column `account` in `account_moderation_notes`

* Change account_id and target_account_id to non-nullable in account_moderation_notes

* Add dependent: :destroy to account and target_account in account_moderation_notes
2017-10-10 13:12:17 +02:00
Eugen Rochko
1c6fc0e4ce Center error layout (#5289) 2017-10-09 20:51:36 +02:00
Akihiko Odaki
cc796298c9 Fix pagination in Api::V1::BlocksController (#5285) 2017-10-09 17:30:31 +02:00
beatrix
f0a2a6c875 try to tighten up local only toot stuff, like... properly (#163)
* try to tighten up local only toot stuff, like... properly

* try to un-break tests
2017-10-09 09:56:17 -04:00
Eugen Rochko
6e9e0c14e6 Fix dependency of error page generation on database (#5280) 2017-10-09 10:05:10 +02:00
Eugen Rochko
3888a12c79 Fix #5272 - Order of checks in ActivityPub handler (#5276) 2017-10-08 22:03:34 +02:00
Eugen Rochko
cfa68907ae Fix #5271 - Fix missing attribute in remove_from_feed (#5277)
Regression from #4801
2017-10-08 21:55:34 +02:00
Eugen Rochko
488584bfc1 Track frequently used emojis in web UI (#5275)
* Track frequently used emojis in web UI

* Persist emoji usage, but debounce commits to the settings API

* Fix #5144 - Add tooltips to picker

* Display only 2 lines of frequently used emojis
2017-10-08 21:47:15 +02:00
Eugen Rochko
0717d9b3e6 Set snowflake IDs for backdated statuses (#5260)
- 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-08 17:34:34 +02:00
Eugen Rochko
6e4046fc3f Fix #5178 - Use object URI only in Announce, instead of embedding (#5266) 2017-10-08 14:41:59 +02:00
Ondřej Hruška
92a3181dc6
improve static page metadata look 2017-10-08 10:46:59 +02:00
JeanGauthier
94f15338c3 i18n update Occitan (#5263)
* Update oc.json

* Update oc.yml

* Update oc.yml

* Update oc.json
2017-10-08 14:18:27 +09:00
Nolan Lawson
db33a53ee8 Video preload should be a string (#5267) 2017-10-08 03:06:43 +02:00
Nolan Lawson
7de6d269d2 Use ES module build of react-router-dom (#5264) 2017-10-08 02:55:58 +02:00
Eugen Rochko
684001d729 Dynamically calculate card height for embeds instead of padding (#5265)
The padding trick was hard-coded to a 16:9 ratio, but we can use
width and height provided from OEmbed information and width
of the card itself to calculate a new height
2017-10-08 02:34:49 +02:00
Eugen Rochko
292f3cd7e0 Show buffering in video player (#5261) 2017-10-08 02:33:08 +02:00
beatrix
7cc0da756d Merge pull request #161 from DJSundog/audio-uploads-feature
Audio uploads feature
2017-10-07 20:13:53 -04:00
DJ Sundog
979b0d66a7 update indentation 2017-10-07 13:53:46 -07:00
DJ Sundog
6ca03a7f58 add faststart to audio transcoding 2017-10-07 19:59:22 +00:00
DJ Sundog
96ba3482b9 adding support for audio uploads, transcoded to mp4 videos 2017-10-07 19:54:10 +00:00
nullkal
633426b261 Add moderation note (#5240)
* Add moderation note

* Add frozen_string_literal

* Make rspec pass
2017-10-07 20:26:43 +02:00
Eugen Rochko
f486ef2666 Redesign public hashtag pages (#5237) 2017-10-07 20:00:35 +02:00
Eugen Rochko
d2dee6ea43 Fix custom emoji in emoji picker, persist skin tone (#5258) 2017-10-07 19:02:30 +02:00
Eugen Rochko
967e70663f In REST API, when URL can be missing, cast it to nil (#5259) 2017-10-07 18:55:48 +02:00
MitarashiDango
b7e65a004f Japanese translation (relative time) (#5251) 2017-10-08 01:32:03 +09:00
Eugen Rochko
3a3475450e Encode custom emojis as resolveable objects in ActivityPub (#5243)
* Encode custom emojis as resolveable objects in ActivityPub

* Improve code style
2017-10-07 17:43:42 +02:00
Nolan Lawson
057db0ecd0 Update emoji-mart to v2.1.1 (#5256) 2017-10-07 12:17:02 +02:00
Eugen Rochko
11436358b4 Fix regression from #5206 - deduplicate descendants (#5253) 2017-10-07 12:16:39 +02:00
kibigo!
6610d57f91 Basic static metadata styling 2017-10-06 22:22:34 -07:00
Eugen Rochko
45682f876d Make auto-play GIFs preference affect custom emojis in web UI (#5254) 2017-10-07 02:38:52 +02:00
Lynx Kotoura
5a2c7bd4ce Fix overflowing in web UI (#5246)
* Fix overflowing in web UI

* Revert fixing dropdown menu modal
2017-10-06 20:40:17 +02:00
unarist
5c8ca024ef Improve error handling on LinkCrawlWorker (#5250)
* Improve error handling on LinkCrawlWorker

* Ignore TimeoutError and InvalidURIError too
* Record errors to debug log
* Enable dead job queue on LinkCrawlWorker

Since most of acceptable errors were already ignored, only our side issue should go to dead job queue.

* Ignore all http gem errors
2017-10-06 20:39:08 +02:00
unarist
d8b2f89d33 Fix remote profile being displayed in HTML on remote_follow (#5249) 2017-10-06 20:38:29 +02:00
K.SHIRAKASHI
d5f490b1a2 Fix error on reloading status detail column (#5248) 2017-10-06 20:37:56 +02:00
MIYAGI Hikaru
6f2d88dd28 Fix error at emoji_compressed in Firefox ESR (#5241) 2017-10-06 16:40:41 +02:00
Lynx Kotoura
daa59dd454 Fix theme settings (#5242) 2017-10-06 13:29:53 +02:00
Nolan Lawson
72d939b69f Fix thinking_face emoji autocomplete (#5238) 2017-10-06 12:03:13 +02:00
Ondřej Hruška
37e141bccb
comment out unused stuff with Video 2017-10-06 09:23:28 +02:00
Nolan Lawson
97b3d0cd56 Import only Spring/Motion from react-motion (#5236) 2017-10-06 03:46:15 +02:00
Nolan Lawson
fd7f0732fe Compress and combine emoji data (#5229) 2017-10-06 03:42:34 +02:00
Nolan Lawson
2aca22b8ea import only Overlay from react-overlays (#5235) 2017-10-06 03:24:33 +02:00
Eugen Rochko
7db0f8dcb2 Implement hotkeys for web UI (#5164)
* Fix #2102 - Implement hotkeys

Hotkeys on status list:

- r to reply
- m to mention author
- f to favourite
- b to boost
- enter to open status
- p to open author's profile
- up or k to move up in the list
- down or j to move down in the list
- 1-9 to focus a status in one of the columns
- n to focus the compose textarea
- alt+n to start a brand new toot
- backspace to navigate back

* Add navigational hotkeys

The key g followed by:

- s: start
- h: home
- n: notifications
- l: local timeline
- t: federated timeline
- f: favourites
- u: own profile
- p: pinned toots
- b: blocked users
- m: muted users

* Add hotkey for focusing search, make escape un-focus compose/search

* Fix focusing notifications column, fix hotkeys in compose textarea
2017-10-06 01:07:59 +02:00
Eugen Rochko
49cc0eb3e7 Improve admin UI for custom emojis, add copy/disable/enable (#5231) 2017-10-05 23:42:05 +02:00
Eugen Rochko
b9c76e2edb When processing custom emoji, ensure a non-animated version exists (#5230)
Use the non-animated version in web UI, but return both in API
2017-10-05 23:41:47 +02:00
Ondřej Hruška
f82e90bf11
workaround for notif clearing 2017-10-05 21:55:02 +02:00
ThibG
2559d9166c Fix regression in FetchRemoteResourceService (#5217)
* Fix regression in FetchRemoteResourceService

* Update specs to match interface changes made in #5114
2017-10-05 00:21:44 +02:00
Lynx Kotoura
32e8a87830 adjust public profile pages 2 (#5223) 2017-10-04 22:49:36 +02:00
Eugen Rochko
b406e3cc4c Fix #5050 - Use summary_large_image only with media attachments (#5219) 2017-10-04 19:06:23 +02:00
Lynx Kotoura
43577e9f59 Fix style of email domain block table (#5218) 2017-10-04 18:16:30 +02:00
MitarashiDango
ecfa1c3f3b fix error (When part of conversation has already been deleted.) (#5216) 2017-10-04 16:28:39 +02:00
utam0k
b3af3f9f8c Implement EmailBlackList (#5109)
* Implement BlacklistedEmailDomain

* Use Faker::Internet.domain_name

* Remove note column

* Add frozen_string_literal comment

* Delete unnecessary codes

* Sort alphabetically

* Change of wording

* Rename BlacklistedEmailDomain to EmailDomainBlock
2017-10-04 15:16:10 +02:00
Ryo Kajiwara
d5091387c6 Supply @instance variable in password reset instructions / password change mailer (#5215) 2017-10-04 13:25:24 +02:00
Yamagishi Kazutoshi
178f718a9b Separate notifications preferences from general preferences (#4447)
* Separate notifications preferences from general preferences

* Refine settings/notifications/show

* remove preferences.notifications
2017-10-04 10:22:52 +02:00
ThibG
0e1b0f2747 Check Webfinger-returned author URI even when not redirected (#5213)
The whole point of verified_webfinger? is to check the WebFinger-discoverable
URI maps back to the known author URI. This was not actually verified if the
first Webfinger request was not a redirection.
2017-10-04 09:59:28 +02:00
aschmitz
468523f4ad Non-Serial ("Snowflake") IDs (#4801)
* Use non-serial IDs

This change makes a number of nontrivial tweaks to the data model in
Mastodon:

* All IDs are now 8 byte integers (rather than mixed 4- and 8-byte)
* IDs are now assigned as:
  * Top 6 bytes: millisecond-resolution time from epoch
  * Bottom 2 bytes: serial (within the millisecond) sequence number
  * See /lib/tasks/db.rake's `define_timestamp_id` for details, but
    note that the purpose of these changes is to make it difficult to
    determine the number of objects in a table from the ID of any
    object.
* The Redis sorted set used for the feed will have values used to look
  up toots, rather than scores. This is almost always the same as the
  existing behavior, except in the case of boosted toots. This change
  was made because Redis stores scores as double-precision floats,
  which cannot store the new ID format exactly. Note that this doesn't
  cause problems with sorting/pagination, because ZREVRANGEBYSCORE
  sorts lexicographically when scores are tied. (This will still cause
  sorting issues when the ID gains a new significant digit, but that's
  extraordinarily uncommon.)

Note a couple of tradeoffs have been made in this commit:

* lib/tasks/db.rake is used to enforce many/most column constraints,
  because this commit seems likely to take a while to bring upstream.
  Enforcing a post-migrate hook is an easier way to maintain the code
  in the interim.
* Boosted toots will appear in the timeline as many times as they have
  been boosted. This is a tradeoff due to the way the feed is saved in
  Redis at the moment, but will be handled by a future commit.

This would effectively close Mastodon's #1059, as it is a
snowflake-like system of generating IDs. However, given how involved
the changes were simply within Mastodon, it may have unexpected
interactions with some clients, if they store IDs as doubles
(or as 4-byte integers). This was a problem that Twitter ran into with
their "snowflake" transition, particularly in JavaScript clients that
treated IDs as JS integers, rather than strings. It therefore would be
useful to test these changes at least in the web interface and popular
clients before pushing them to all users.

* 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

* Restructure feed pushes/unpushes

This was necessary because the previous behavior used Redis zset scores
to identify statuses, but those are IEEE double-precision floats, so we
can't actually use them to identify all 64-bit IDs. However, it leaves
the code in a much better state for refactoring reblog handling /
coalescing.

Feed-management code has been consolidated in FeedManager, including:

* BatchedRemoveStatusService no longer directly manipulates feed zsets
* RemoveStatusService no longer directly manipulates feed zsets
* PrecomputeFeedService has moved its logic to FeedManager#populate_feed

(PrecomputeFeedService largely made lots of calls to FeedManager, but
didn't follow the normal adding-to-feed process.)

This has the effect of unifying all of the feed push/unpush logic in
FeedManager, making it much more tractable to update it in the future.

Due to some additional checks that must be made during, for example,
batch status removals, some Redis pipelining has been removed. It does
not appear that this should cause significantly increased load, but if
necessary, some optimizations are possible in batch cases. These were
omitted in the pursuit of simplicity, but a batch_push and batch_unpush
would be possible in the future.

Tests were added to verify that pushes happen under expected conditions,
and to verify reblog behavior (both on pushing and unpushing). In the
case of unpushing, this includes testing behavior that currently leads
to confusion such as Mastodon's #2817, but this codifies that the
behavior is currently expected.

* Rubocop fixes

I could swear I made these changes already, but I must have lost them
somewhere along the line.

* Address review comments

This addresses the first two comments from review of this feature:

https://github.com/tootsuite/mastodon/pull/4801#discussion_r139336735
https://github.com/tootsuite/mastodon/pull/4801#discussion_r139336931

This adds an optional argument to FeedManager#key, the subtype of feed
key to generate. It also tests to ensure that FeedManager's settings are
such that reblogs won't be tracked forever.

* Hardcode IdToBigints migration columns

This addresses a comment during review:
https://github.com/tootsuite/mastodon/pull/4801#discussion_r139337452

This means we'll need to make sure that all _id columns going forward
are bigints, but that should happen automatically in most cases.

* 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.

* Only implement timestamp IDs for Status IDs

Per discussion in #4801, this is only being merged in for Status IDs at
this point. We do this in a migration, as there is no longer use for
a post-migration hook. We keep the initialization of the timestamp_id
function as a Rake task, as it is also needed after db:schema:load (as
db/schema.rb doesn't store Postgres functions).

* Change internal streaming payloads to stringified IDs as well

This is equivalent to 591a9af356faf2d5c7e66e3ec715502796c875cd from
#5019, with an extra change for the addition to FeedManager#unpush.

* Ensure we have a status_id_seq sequence

Apparently this is not a given when specifying a custom ID function,
so now we ensure it gets created. This uses the generic version of this
function to more easily support adding additional tables with timestamp
IDs in the future, although it would be possible to cut this down to a
less generic version if necessary. It is only run during db:schema:load
or the relevant migration, so the overhead is extraordinarily minimal.

* Transition reblogs to new Redis format

This provides a one-way migration to transition old Redis reblog entries
into the new format, with a separate tracking entry for reblogs.

It is not invertible because doing so could (if timestamp IDs are used)
require a database query for each status in each users' feed, which is
likely to be a significant toll on major instances.

* Address review comments from @akihikodaki

No functional changes.

* Additional review changes

* Heredoc cleanup

* Run db:schema:load hooks for test in development

This matches the behavior in Rails'
ActiveRecord::Tasks::DatabaseTasks.each_current_configuration, which
would otherwise break `rake db:setup` in development.

It also moves some functionality out to a library, which will be a good
place to put additional related functionality in the near future.
2017-10-04 09:56:37 +02:00
Yamagishi Kazutoshi
d40c9140e8 Fix undefined local variable (regression from #5114) (#5210) 2017-10-04 09:51:42 +02:00
Eugen Rochko
632178d754 Use own, shorter relative timestamps (#5171)
* Use own, shorter relative timestamps

* Add acct to title tooltip of display name in statuses

* Improve i18n of the relative times
2017-10-04 01:23:52 +02:00