Commit graph

6390 commits

Author SHA1 Message Date
Ekaterina Vaartis
ea582fbf93 Rename search.ex to database_search.ex and add search/2 2022-06-29 20:49:00 +01:00
Ekaterina Vaartis
d99a2be351 Only add local posts to index in activity_pub
Remote ones are already added in another place
2022-06-29 20:48:44 +01:00
Ekaterina Vaartis
37913c8ddf Use proper deleted object for removing from index 2022-06-29 20:48:44 +01:00
Ekaterina Vaartis
a937a98df5 Don't try removing from index again in common_api
It's already removed in the side effects of the pipeline
2022-06-29 20:48:44 +01:00
Ekaterina Vaartis
b3401ba7bd Also index incoming federated posts 2022-06-29 20:48:29 +01:00
Ekaterina Vaartis
e5ac2ffa07 Ensure only indexing public posts and implement clearing and delete 2022-06-29 20:48:29 +01:00
Ekaterina Vaartis
e961cf2689 Initial meilisearch implementation, doesn't delete posts yet 2022-06-29 20:48:28 +01:00
8f140deb8f StealEmojiPolicy: fix String rejected_shortcodes
* rejected_shortcodes is defined as a list of strings in the
  configuration description. As such, database-based configuration was
  led to handle those settings as strings, and not as the actually
  expected type, Regex.
* This caused each message passing through this MRF, if a rejected
  shortcode was set and the emoji did not exist already on the instance,
  to fail federating, as an exception was raised, swiftly caught and
  mostly silenced.
* This commit fixes the issue by introducing new behavior: strings are
  now handled as perfect matches for an emoji shortcode (meaning that if
  the emoji-to-be-pulled's shortcode is in the blacklist, it will be
  rejected), while still supporting Regex types as before.
2022-06-29 20:47:45 +01:00
Ilja
661d0ba481 Also use actor_type to determine if an account is a bot in antiFollowbotPolicy 2022-06-29 20:47:44 +01:00
Tusooa Zhu
3fd87b6a75 Skip cache when /objects or /activities is authenticated
Ref: fix-local-public
2022-06-29 20:47:27 +01:00
Tusooa Zhu
932e5df19e Allow to skip cache in Cache plug
Ref: fix-local-public
2022-06-29 20:47:26 +01:00
Tusooa Zhu
33d821256e Fix incorrect fallback when English is set to first language 2022-06-29 20:47:10 +01:00
Tusooa Zhu
2df25e6666 Support fallbacking to other languages 2022-06-29 20:47:10 +01:00
Tusooa Zhu
fcfb5a4967 Lint 2022-06-29 20:47:10 +01:00
Tusooa Zhu
07bd35227a Support multiple locales from userLanguage cookie 2022-06-29 20:47:10 +01:00
Tusooa Zhu
fa95bc8725 Support multiple locales formally
elixir gettext current does not fully support fallback to another language [0].
But it might in the future. We adapt it so that all languages in Accept-Language
headers are received by Pleroma.Web.Gettext. User.languages is now a comma-separated
list.

[0]: https://github.com/elixir-gettext/gettext/issues/303
2022-06-29 20:47:10 +01:00
Tusooa Zhu
845e5769ce Make lint happy 2022-06-29 20:47:10 +01:00
Tusooa Zhu
ef73f61b07 Fallback to a variant if the language in general is not supported
For an example, here, zh is not supported, but zh_Hans and zh_Hant
are. If the user asks for zh, we should choose a variant for them
instead of fallbacking to default.

Some browsers (e.g. Firefox) does not allow users to customize
their language codes. For example, there is no zh-Hans, but only
zh, zh-CN, zh-TW, zh-HK, etc. This provides a workaround for
those users suffering from bad design decisions.
2022-06-29 20:47:10 +01:00
Tusooa Zhu
72bdb0640f Allow user to register with custom language 2022-06-29 20:46:51 +01:00
Tusooa Zhu
1b77308644 Allow update_credentials to update User.language 2022-06-29 20:45:35 +01:00
Tusooa Zhu
7726148472 Send emails i18n'd using backend-stored user language 2022-06-29 20:45:19 +01:00
Tusooa Zhu
63a0536d55 Make mail and mailer translatable 2022-06-29 20:45:05 +01:00
Tusooa Zhu
39cfecb188 Make static fe translatable 2022-06-29 20:45:05 +01:00
Tusooa Zhu
03aac29531 Fix tests 2022-06-29 20:45:05 +01:00
Tusooa Zhu
c6652fccae Make mfa pages translatable 2022-06-29 20:45:03 +01:00
Tusooa Zhu
8f8d2abb12 Make oauth pages translatable 2022-06-29 20:44:48 +01:00
Tusooa Zhu
793922f1d8 Use proper lang attributes in htmls 2022-06-29 20:44:16 +01:00
Tusooa Zhu
ec57e3480c Make tag feed translatable 2022-06-29 20:44:16 +01:00
Tusooa Zhu
50913c4dc5 Make password reset pages translatable 2022-06-29 20:44:16 +01:00
Tusooa Zhu
8f08c902a5 Make lint happy 2022-06-29 20:44:16 +01:00
Tusooa Zhu
ed1d9e91bc Make remote follow pages translatable 2022-06-29 20:44:15 +01:00
Tusooa Zhu
775f997c40 Prefer userLanguage cookie over Accept-Language header in detecting locale
https://git.pleroma.social/pleroma/pleroma-meta/-/issues/60
2022-06-29 20:43:41 +01:00
2342fface1 Add visibility check in context path (#26)
Reviewed-on: AkkomaGang/akkoma#26
2022-06-29 09:33:57 +00:00
064c36274c Purge gopher frontend 2022-06-27 17:31:16 +01:00
d392fafa06 Remove debug prints 2022-06-25 18:43:19 +01:00
f2ff05637f Allow for embedding object data in publish 2022-06-25 18:41:26 +01:00
45b7d18871 update api spec for custom emoji reaction 2022-06-25 15:45:10 +01:00
3928cecf6b ensure local statuses are not visible remotely 2022-06-22 17:06:40 +01:00
34e11cef47 check for local_public? on AP route 2022-06-22 16:35:12 +01:00
502382da45 cherry-pick security from upstream 2022-06-22 16:25:05 +01:00
f2f8b81fc4
Use mediaproxy for emoji notifications if enabled 2022-06-17 14:27:22 +02:00
6e1d9c63da allow %{source} dict in no_empty 2022-06-14 17:41:25 +01:00
abefbcec64 Merge branch 'mfm' into develop 2022-06-14 16:25:47 +01:00
0627da0027 mix format 2022-06-14 16:25:28 +01:00
829ae13572 ensure tests pass 2022-06-14 16:24:03 +01:00
4fb2251221 Allow authoring MFM 2022-06-14 15:56:12 +01:00
3f06ccc9e3 allow source from misskey 2022-06-14 10:56:18 +01:00
60bfaed368
Allow reacting with emojis containing a number 2022-06-14 11:47:09 +02:00
0f5bea2465 Add emoji_url to notifications to allow rendering
Ref #5
2022-06-12 13:35:14 +01:00
2abf8c982e fix secret key failure 2022-06-11 16:48:04 +01:00