Commit graph

5401 commits

Author SHA1 Message Date
Hélène
bb768244a4
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-05-26 20:06:41 +02:00
Ilja
75169a45f6
Also use actor_type to determine if an account is a bot in antiFollowbotPolicy 2022-05-09 10:44:43 -05:00
Tusooa Zhu
ecf4e51849
Skip cache when /objects or /activities is authenticated
Ref: fix-local-public
2022-05-09 10:44:43 -05:00
Tusooa Zhu
370a241dbc
Allow to skip cache in Cache plug
Ref: fix-local-public
2022-05-09 10:44:43 -05:00
Tusooa Zhu
f52283004b
Fix incorrect fallback when English is set to first language 2022-05-09 10:44:43 -05:00
Ilja
d48ade7629
Fix eratic test for POST /api/pleroma/admin/reports/:id/notes
It retrieved two ReportNotes and then checked one of them. But the order isn't guaranteed, while the test tested on the content of the first ReportNote.

I made the test on the content more generic
2022-05-09 10:44:43 -05:00
Tusooa Zhu
57faa36243
Support fallbacking to other languages 2022-05-09 10:44:43 -05:00
Tusooa Zhu
ed9681270e
Lint 2022-05-09 10:44:43 -05:00
Tusooa Zhu
20c6b3c597
Support multiple locales from userLanguage cookie 2022-05-09 10:44:43 -05:00
Tusooa Zhu
f3b7ee7836
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-05-09 10:44:43 -05:00
Tusooa Zhu
2b8a625083
Add test for fallbacking to a general language 2022-05-09 10:44:43 -05:00
Tusooa Zhu
3e5bfa03d0
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-05-09 10:44:43 -05:00
Tusooa Zhu
d831e57089
Allow user to register with custom language 2022-05-09 10:44:43 -05:00
Tusooa Zhu
8e1d3b5591
Send emails i18n'd using backend-stored user language 2022-05-09 10:44:43 -05:00
Tusooa Zhu
7e05ec625d
Fix digest test 2022-05-09 10:44:43 -05:00
Tusooa Zhu
2e69846e65
Prefer userLanguage cookie over Accept-Language header in detecting locale
https://git.pleroma.social/pleroma/pleroma-meta/-/issues/60
2022-05-09 10:44:43 -05:00
Ilja
d3ad9e927d
Delete report notifs when demoting from superuser
When someone isn't a superuser any more, they shouldn't see the reporsts any more either.
Here we delete the report notifications from a user when that user gets updated from being a superuser to a non-superuser.
2022-05-09 10:44:43 -05:00
Ilja
28c37dc386
Fix test get_user_apps/1
For some reason I had a test who suddenly failed, mix test test/pleroma/web/o_auth/app_test.exs:54. A user has a list of applications and this test adds them and then sees if the list it gets back is the same as the apps it added.

When I ran mix test a day before I didn't have this problem and when I pushed code today in a different MR, the pipeline succeeded (see https://git.pleroma.social/ilja/pleroma/-/jobs/205827), yet locally it failed. So it seems the test can sometimes succeed and sometimes fail, which makes it untrustworthy.

The failure I see is because the returned list is in reverse order. I assume that's not per sé wrong. You just want to know if the apps you added are actually there. I fixed the test by first ordering the lists before comparing.

AFAICT (and as far as that's relevant) the test got introduced in commit cb2a072e62
2022-03-19 16:57:38 +01:00
feld
9d518b65fd
Revert "Merge branch 'revert/notice-routes' into 'develop'"
This reverts merge request !3576
2022-03-05 00:34:01 +01:00
Sean King
2842684e81
Revert "Merge branch 'notice-routes' into 'develop'" 2022-03-05 00:34:00 +01:00
a665b34769
Add unicode 14 support
and add a test with a unicode 14 emoji
2022-02-21 17:27:22 -06:00
0fb1684fb7
Update copyright, also
https://codeberg.org/newroma-dev/newroma/pulls/12

Signed-off-by: Sam Therapy <sam@samtherapy.net>
2022-02-12 11:53:32 -06:00
marcin mikołajczak
e473bcf7a0 Max media attachment count
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-02-06 17:41:15 +01:00
Alex Gleason
7c044a1841
FilterControllerTest: tag erratic test 2022-02-02 13:10:39 -06:00
Haelwenn (lanodan) Monnier
d1cc9e4eaf
Fix tests matching on "warn"
Moving it to "warning" would break tests on 1.12.x
2022-02-02 12:45:26 -06:00
Alex Gleason
bd81af731e
Tag erratic test 2022-02-02 12:29:53 -06:00
Alex Gleason
2d77976305
Add tests for mismatched context in replies 2022-02-02 12:19:35 -06:00
Alex Gleason
5a4e3aa715
Test that a Create/Note from Roadhouse validates 2022-02-02 11:02:23 -06:00
Alex Gleason
61dfeca1cc
Test that a Note from Roadhouse validates 2022-02-02 10:38:30 -06:00
Alex Gleason
3bf257171f
ForceMentionsInContent: improve display of Markdown posts 2022-01-27 14:15:06 -06:00
Alex Gleason
27cb3d6273
ForceMentionsInContent: don't apply it to top-level posts 2022-01-26 21:24:26 -06:00
Alex Gleason
0604b0dd09
ForceMentionsInContent: don't mention self 2022-01-25 12:33:47 -06:00
Alex Gleason
0f4e0e667e Merge branch 'recipients-inline' into 'develop'
ForceMentionsInContent: wrap mentions in a span, fix the formatting

See merge request pleroma/pleroma!3620
2022-01-25 17:43:39 +00:00
Alex Gleason
99e9c2c668 Merge branch 'birth-dates' into 'develop'
Fix show_birthday

See merge request pleroma/pleroma!3621
2022-01-25 16:59:07 +00:00
Alex Gleason
65b4d2ce84
ForceMentionsInContent: fix order of mentions 2022-01-25 10:42:34 -06:00
marcin mikołajczak
ab12a05a43 AccountView: Add test for show_birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-25 17:34:36 +01:00
Alex Gleason
dd7977bb68 Merge branch 'birth-dates' into 'develop'
Birth dates

See merge request pleroma/pleroma!3608
2022-01-25 15:35:47 +00:00
Alex Gleason
267184b70e
ForceMentionsInContentTest: return mentions in a not terrible format 2022-01-24 20:03:43 -06:00
marcin mikołajczak
75c4fefb1c Add a test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 13:03:00 +01:00
marcin mikołajczak
e3d394eef6 Birthdays: Fix tests, add test for misskey
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 09:41:21 +01:00
marcin mikołajczak
0266bc3c96 Birthdays: hide_birthday -> show_birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-23 09:13:33 +01:00
Alex Gleason
aaa9314f4c
Merge remote-tracking branch 'origin/develop' into birth-dates 2022-01-22 14:24:50 -06:00
Alex Gleason
66e8c6f90f
Birthdays: birth_date --> birthday 2022-01-22 13:21:55 -06:00
NEETzsche
7a015b1fe2 Make test less erratic by adding five second tolerance 2022-01-22 12:07:54 -07:00
Alex Gleason
f5d4ef50b4
FilterTest: tag erratic test 2022-01-22 12:13:09 -06:00
Alex Gleason
6ffe43af70 Merge branch 'private-pins' into 'develop'
Support private pinned posts from Mastodon

See merge request pleroma/pleroma!3611
2022-01-20 23:18:24 +00:00
Alex Gleason
00523bdf5e
Test pinned private statuses in AccountController 2022-01-20 16:54:43 -06:00
marcin mikołajczak
88c21b9282 Support private pinned posts from Mastodon
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-20 12:35:32 +01:00
rinpatch
a02cfd7f52 Add ForceMentionsInContentPolicy
Even though latest PleromaFE supports displaying these properly, mobile
apps still exist, so I think we should offer a workaround to those who
want it.
2022-01-19 21:04:57 +03:00
marcin mikołajczak
dfb2808535 Birth dates: Add tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-01-18 23:15:31 +01:00