summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--.gitlab/merge_request_templates/Release.md10
-rw-r--r--CHANGELOG.md15
-rw-r--r--docs/administration/updating.md2
-rw-r--r--lib/pleroma/activity.ex8
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex19
-rw-r--r--lib/pleroma/web/api_spec/operations/account_operation.ex4
-rw-r--r--mix.exs2
-rw-r--r--priv/gettext/ko/LC_MESSAGES/default.po197
-rw-r--r--priv/scrubbers/default.ex3
-rw-r--r--priv/scrubbers/twitter_text.ex3
-rw-r--r--test/pleroma/activity_test.exs1
-rw-r--r--test/pleroma/html_test.exs26
-rw-r--r--test/pleroma/web/mastodon_api/controllers/account_controller_test.exs40
-rw-r--r--test/pleroma/web/mastodon_api/controllers/search_controller_test.exs1
15 files changed, 302 insertions, 33 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 329904bbe..92ea3f494 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -260,6 +260,8 @@ amd64:
- develop@pleroma/pleroma
- /^maint/.*$/@pleroma/pleroma
- /^release/.*$/@pleroma/pleroma
+ tags:
+ - amd64
artifacts: &release-artifacts
name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
paths:
@@ -292,6 +294,8 @@ amd64-musl:
stage: release
artifacts: *release-artifacts
only: *release-only
+ tags:
+ - amd64
image: elixir:1.10.4-alpine
cache: *release-cache
variables: *release-variables
diff --git a/.gitlab/merge_request_templates/Release.md b/.gitlab/merge_request_templates/Release.md
index b2c772696..9638d6d11 100644
--- a/.gitlab/merge_request_templates/Release.md
+++ b/.gitlab/merge_request_templates/Release.md
@@ -1,6 +1,8 @@
### Release checklist
-* [ ] Bump version in `mix.exs`
-* [ ] Compile a changelog
-* [ ] Create an MR with an announcement to pleroma.social
-* [ ] Tag the release
+* [ ] Bump version in `mix.exs`
+* [ ] Compile a changelog
+* [ ] Create an MR with an announcement to pleroma.social
+#### post-merge
+* [ ] Tag the release on the merge commit
+* [ ] Make the tag into a Gitlab Releaseā„¢
* [ ] Merge `stable` into `develop` (in case the fixes are already in develop, use `git merge -s ours --no-commit` and manually merge the changelogs)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66d01e005..a3cff84a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -58,10 +58,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fixed account deletion API
- Fixed lowercase HTTP HEAD method in the Media Proxy Preview code
- Removed useless notification call on Delete activities
+- Improved performance for filtering out deactivated and invisible users
### Removed
- Quack, the logging backend that pushes to Slack channels
+## 2.4.5 - 2022-08-27
+
+## Fixed
+- Image `class` attributes not being scrubbed, allowing to exploit frontend special classes [!3792](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3792)
+- Delete report notifs when demoting from superuser [!3642](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3642)
+- Validate `mediaType` only by it's format rather than using a list [!3597](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3597)
+- Pagination: Make mutes and blocks lists behave the same as other lists [!3693](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3693)
+- Compatibility with Elixir 1.14 [!3740](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3740)
+- Frontend installer: FediFE build URL [!3736](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3736)
+- Streaming: Don't stream ChatMessage into the home timeline [!3738](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3738)
+- Streaming: Stream local-only posts in the local timeline [!3738](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3738)
+- Signatures: Fix `keyId` lookup for GoToSocial [!3725](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3725)
+- Validator: Fix `replies` handling for GoToSocial [!3725](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3725)
+
## 2.4.4 - 2022-08-19
### Security
diff --git a/docs/administration/updating.md b/docs/administration/updating.md
index 01d3b9b0e..00eca36a0 100644
--- a/docs/administration/updating.md
+++ b/docs/administration/updating.md
@@ -17,7 +17,7 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
## For from source installations (using git)
1. Go to the working directory of Pleroma (default is `/opt/pleroma`)
-2. Run `git pull` [^1]. This pulls the latest changes from upstream.
+2. Run `git checkout <tagged release>` [^1]. e.g. `git checkout v2.4.5` This pulls the [tagged release](https://git.pleroma.social/pleroma/pleroma/-/releases) from upstream.
3. Run `mix deps.get` [^1]. This pulls in any new dependencies.
4. Stop the Pleroma service.
5. Run `mix ecto.migrate` [^1] [^2]. This task performs database migrations, if there were any.
diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex
index ebfd4ed45..3556aaf9e 100644
--- a/lib/pleroma/activity.ex
+++ b/lib/pleroma/activity.ex
@@ -361,9 +361,11 @@ defmodule Pleroma.Activity do
end
def restrict_deactivated_users(query) do
- deactivated_users_query = from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)
-
- from(activity in query, where: activity.actor not in subquery(deactivated_users_query))
+ query
+ |> join(:inner, [activity], user in User,
+ as: :user,
+ on: activity.actor == user.ap_id and user.is_active == true
+ )
end
defdelegate search(user, query, options \\ []), to: Pleroma.Activity.Search
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 5099caef7..fa251394b 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -1239,15 +1239,15 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end
+ defp exclude_invisible_actors(query, %{type: "Flag"}), do: query
defp exclude_invisible_actors(query, %{invisible_actors: true}), do: query
defp exclude_invisible_actors(query, _opts) do
- invisible_ap_ids =
- User.Query.build(%{invisible: true, select: [:ap_id]})
- |> Repo.all()
- |> Enum.map(fn %{ap_id: ap_id} -> ap_id end)
-
- from([activity] in query, where: activity.actor not in ^invisible_ap_ids)
+ query
+ |> join(:inner, [activity], u in User,
+ as: :u,
+ on: activity.actor == u.ap_id and u.invisible == false
+ )
end
defp exclude_id(query, %{exclude_id: id}) when is_binary(id) do
@@ -1377,7 +1377,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|> restrict_instance(opts)
|> restrict_announce_object_actor(opts)
|> restrict_filtered(opts)
- |> Activity.restrict_deactivated_users()
+ |> maybe_restrict_deactivated_users(opts)
|> exclude_poll_votes(opts)
|> exclude_chat_messages(opts)
|> exclude_invisible_actors(opts)
@@ -1789,4 +1789,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|> restrict_visibility(%{visibility: "direct"})
|> order_by([activity], asc: activity.id)
end
+
+ defp maybe_restrict_deactivated_users(activity, %{type: "Flag"}), do: activity
+
+ defp maybe_restrict_deactivated_users(activity, _opts),
+ do: Activity.restrict_deactivated_users(activity)
end
diff --git a/lib/pleroma/web/api_spec/operations/account_operation.ex b/lib/pleroma/web/api_spec/operations/account_operation.ex
index aed59293c..012cbdc79 100644
--- a/lib/pleroma/web/api_spec/operations/account_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/account_operation.ex
@@ -223,12 +223,12 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
type: :object,
properties: %{
reblogs: %Schema{
- type: :boolean,
+ allOf: [BooleanLike],
description: "Receive this account's reblogs in home timeline? Defaults to true.",
default: true
},
notify: %Schema{
- type: :boolean,
+ allOf: [BooleanLike],
description:
"Receive notifications for all statuses posted by the account? Defaults to false.",
default: false
diff --git a/mix.exs b/mix.exs
index 26a9b2826..eb635cac9 100644
--- a/mix.exs
+++ b/mix.exs
@@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do
def project do
[
app: :pleroma,
- version: version("2.4.53"),
+ version: version("2.4.55"),
elixir: "~> 1.10",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
diff --git a/priv/gettext/ko/LC_MESSAGES/default.po b/priv/gettext/ko/LC_MESSAGES/default.po
new file mode 100644
index 000000000..55b695d6b
--- /dev/null
+++ b/priv/gettext/ko/LC_MESSAGES/default.po
@@ -0,0 +1,197 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2022-12-01 19:17+0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 3.7.2\n"
+
+## This file is a PO Template file.
+##
+## "msgid"s here are often extracted from source code.
+## Add new translations manually only if they're dynamic
+## translations that can't be statically extracted.
+##
+## Run "mix gettext.extract" to bring this file up to
+## date. Leave "msgstr"s empty as changing them here as no
+## effect: edit them in PO (.po) files instead.
+
+#: lib/pleroma/web/api_spec/render_error.ex:122
+#, elixir-autogen, elixir-format
+msgid "%{name} - %{count} is not a multiple of %{multiple}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:131
+#, elixir-autogen, elixir-format
+msgid "%{name} - %{value} is larger than exclusive maximum %{max}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:140
+#, elixir-autogen, elixir-format
+msgid "%{name} - %{value} is larger than inclusive maximum %{max}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:149
+#, elixir-autogen, elixir-format
+msgid "%{name} - %{value} is smaller than exclusive minimum %{min}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:158
+#, elixir-autogen, elixir-format
+msgid "%{name} - %{value} is smaller than inclusive minimum %{min}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:102
+#, elixir-autogen, elixir-format
+msgid "%{name} - Array items must be unique."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:114
+#, elixir-autogen, elixir-format
+msgid "%{name} - Array length %{length} is larger than maxItems: %{}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:106
+#, elixir-autogen, elixir-format
+msgid "%{name} - Array length %{length} is smaller than minItems: %{min}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:166
+#, elixir-autogen, elixir-format
+msgid "%{name} - Invalid %{type}. Got: %{value}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:174
+#, elixir-autogen, elixir-format
+msgid "%{name} - Invalid format. Expected %{format}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:51
+#, elixir-autogen, elixir-format
+msgid "%{name} - Invalid schema.type. Got: %{type}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:178
+#, elixir-autogen, elixir-format
+msgid "%{name} - Invalid value for enum."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:95
+#, elixir-autogen, elixir-format
+msgid "%{name} - String length is larger than maxLength: %{length}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:88
+#, elixir-autogen, elixir-format
+msgid "%{name} - String length is smaller than minLength: %{length}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:63
+#, elixir-autogen, elixir-format
+msgid "%{name} - null value where %{type} expected."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:60
+#, elixir-autogen, elixir-format
+msgid "%{name} - null value."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:182
+#, elixir-autogen, elixir-format
+msgid "Failed to cast to any schema in %{polymorphic_type}"
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:71
+#, elixir-autogen, elixir-format
+msgid "Failed to cast value as %{invalid_schema}. Value must be castable using `allOf` schemas listed."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:84
+#, elixir-autogen, elixir-format
+msgid "Failed to cast value to one of: %{failed_schemas}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:78
+#, elixir-autogen, elixir-format
+msgid "Failed to cast value using any of: %{failed_schemas}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:212
+#, elixir-autogen, elixir-format
+msgid "Invalid value for header: %{name}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:204
+#, elixir-autogen, elixir-format
+msgid "Missing field: %{name}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:208
+#, elixir-autogen, elixir-format
+msgid "Missing header: %{name}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:196
+#, elixir-autogen, elixir-format
+msgid "No value provided for required discriminator `%{field}`."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:216
+#, elixir-autogen, elixir-format
+msgid "Object property count %{property_count} is greater than maxProperties: %{max_properties}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:224
+#, elixir-autogen, elixir-format
+msgid "Object property count %{property_count} is less than minProperties: %{min_properties}"
+msgstr ""
+
+#: lib/pleroma/web/templates/static_fe/static_fe/error.html.eex:2
+#, elixir-autogen, elixir-format
+msgid "Oops"
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:188
+#, elixir-autogen, elixir-format
+msgid "Unexpected field: %{name}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:200
+#, elixir-autogen, elixir-format
+msgid "Unknown schema: %{name}."
+msgstr ""
+
+#: lib/pleroma/web/api_spec/render_error.ex:192
+#, elixir-autogen, elixir-format
+msgid "Value used as discriminator for `%{field}` matches no schemas."
+msgstr ""
+
+#: lib/pleroma/web/templates/embed/show.html.eex:43
+#: lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex:37
+#, elixir-autogen, elixir-format
+msgid "announces"
+msgstr ""
+
+#: lib/pleroma/web/templates/embed/show.html.eex:44
+#: lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex:38
+#, elixir-autogen, elixir-format
+msgid "likes"
+msgstr ""
+
+#: lib/pleroma/web/templates/embed/show.html.eex:42
+#: lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex:36
+#, elixir-autogen, elixir-format
+msgid "replies"
+msgstr ""
+
+#: lib/pleroma/web/templates/embed/show.html.eex:27
+#: lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex:22
+#, elixir-autogen, elixir-format
+msgid "sensitive media"
+msgstr ""
diff --git a/priv/scrubbers/default.ex b/priv/scrubbers/default.ex
index 79fa6dcdf..e10e3ec87 100644
--- a/priv/scrubbers/default.ex
+++ b/priv/scrubbers/default.ex
@@ -68,13 +68,14 @@ defmodule Pleroma.HTML.Scrubber.Default do
@allow_inline_images Pleroma.Config.get([:markup, :allow_inline_images])
if @allow_inline_images do
+ Meta.allow_tag_with_this_attribute_values(:img, "class", ["emoji"])
+
# restrict img tags to http/https only, because of MediaProxy.
Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"])
Meta.allow_tag_with_these_attributes(:img, [
"width",
"height",
- "class",
"title",
"alt"
])
diff --git a/priv/scrubbers/twitter_text.ex b/priv/scrubbers/twitter_text.ex
index a121a8209..6e23b3efb 100644
--- a/priv/scrubbers/twitter_text.ex
+++ b/priv/scrubbers/twitter_text.ex
@@ -45,13 +45,14 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do
# allow inline images for custom emoji
if Pleroma.Config.get([:markup, :allow_inline_images]) do
+ Meta.allow_tag_with_this_attribute_values(:img, "class", ["emoji"])
+
# restrict img tags to http/https only, because of MediaProxy.
Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"])
Meta.allow_tag_with_these_attributes(:img, [
"width",
"height",
- "class",
"title",
"alt"
])
diff --git a/test/pleroma/activity_test.exs b/test/pleroma/activity_test.exs
index e38384c9c..a48a68837 100644
--- a/test/pleroma/activity_test.exs
+++ b/test/pleroma/activity_test.exs
@@ -145,6 +145,7 @@ defmodule Pleroma.ActivityTest do
setup do: clear_config([:instance, :limit_to_local_content])
+ @tag :skip_on_mac
test "finds utf8 text in statuses", %{
japanese_activity: japanese_activity,
user: user
diff --git a/test/pleroma/html_test.exs b/test/pleroma/html_test.exs
index 970baf63b..b99689903 100644
--- a/test/pleroma/html_test.exs
+++ b/test/pleroma/html_test.exs
@@ -17,6 +17,7 @@ defmodule Pleroma.HTMLTest do
this is a link with allowed "rel" attribute: <a href="http://example.com/" rel="tag">example.com</a>
this is a link with not allowed "rel" attribute: <a href="http://example.com/" rel="tag noallowed">example.com</a>
this is an image: <img src="http://example.com/image.jpg"><br />
+ this is an inline emoji: <img class="emoji" src="http://example.com/image.jpg"><br />
<script>alert('hacked')</script>
"""
@@ -24,6 +25,10 @@ defmodule Pleroma.HTMLTest do
<img src="http://example.com/image.jpg" onerror="alert('hacked')">
"""
+ @html_stillimage_sample """
+ <img class="still-image" src="http://example.com/image.jpg">
+ """
+
@html_span_class_sample """
<span class="animate-spin">hi</span>
"""
@@ -45,6 +50,7 @@ defmodule Pleroma.HTMLTest do
this is a link with allowed &quot;rel&quot; attribute: example.com
this is a link with not allowed &quot;rel&quot; attribute: example.com
this is an image:
+ this is an inline emoji:
alert(&#39;hacked&#39;)
"""
@@ -67,6 +73,7 @@ defmodule Pleroma.HTMLTest do
this is a link with allowed &quot;rel&quot; attribute: <a href="http://example.com/" rel="tag">example.com</a>
this is a link with not allowed &quot;rel&quot; attribute: <a href="http://example.com/">example.com</a>
this is an image: <img src="http://example.com/image.jpg"/><br/>
+ this is an inline emoji: <img class="emoji" src="http://example.com/image.jpg"/><br/>
alert(&#39;hacked&#39;)
"""
@@ -90,6 +97,15 @@ defmodule Pleroma.HTMLTest do
HTML.filter_tags(@html_span_class_sample, Pleroma.HTML.Scrubber.TwitterText)
end
+ test "does not allow images with invalid classes" do
+ expected = """
+ <img src="http://example.com/image.jpg"/>
+ """
+
+ assert expected ==
+ HTML.filter_tags(@html_stillimage_sample, Pleroma.HTML.Scrubber.TwitterText)
+ end
+
test "does allow microformats" do
expected = """
<span class="h-card"><a class="u-url mention">@<span>foo</span></a></span>
@@ -121,6 +137,7 @@ defmodule Pleroma.HTMLTest do
this is a link with allowed &quot;rel&quot; attribute: <a href="http://example.com/" rel="tag">example.com</a>
this is a link with not allowed &quot;rel&quot; attribute: <a href="http://example.com/">example.com</a>
this is an image: <img src="http://example.com/image.jpg"/><br/>
+ this is an inline emoji: <img class="emoji" src="http://example.com/image.jpg"/><br/>
alert(&#39;hacked&#39;)
"""
@@ -143,6 +160,15 @@ defmodule Pleroma.HTMLTest do
assert expected == HTML.filter_tags(@html_span_class_sample, Pleroma.HTML.Scrubber.Default)
end
+ test "does not allow images with invalid classes" do
+ expected = """
+ <img src="http://example.com/image.jpg"/>
+ """
+
+ assert expected ==
+ HTML.filter_tags(@html_stillimage_sample, Pleroma.HTML.Scrubber.TwitterText)
+ end
+
test "does allow microformats" do
expected = """
<span class="h-card"><a class="u-url mention">@<span>foo</span></a></span>
diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
index 2bf4edb70..958b7f76f 100644
--- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
@@ -896,6 +896,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: true})
|> json_response_and_validate_schema(200)
+ assert %{"showing_reblogs" => true} =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: "1"})
+ |> json_response_and_validate_schema(200)
+
assert [%{"id" => ^reblog_id}] =
conn
|> get("/api/v1/timelines/home")
@@ -925,6 +931,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: false})
|> json_response_and_validate_schema(200)
+ assert %{"showing_reblogs" => false} =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: "0"})
+ |> json_response_and_validate_schema(200)
+
assert [] ==
conn
|> get("/api/v1/timelines/home")
@@ -935,21 +947,23 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
%{conn: conn} = oauth_access(["follow"])
followed = insert(:user)
- ret_conn =
- conn
- |> put_req_header("content-type", "application/json")
- |> post("/api/v1/accounts/#{followed.id}/follow", %{notify: true})
-
- assert %{"id" => _id, "subscribing" => true} =
- json_response_and_validate_schema(ret_conn, 200)
+ assert %{"subscribing" => true} =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/accounts/#{followed.id}/follow", %{notify: true})
+ |> json_response_and_validate_schema(200)
- ret_conn =
- conn
- |> put_req_header("content-type", "application/json")
- |> post("/api/v1/accounts/#{followed.id}/follow", %{notify: false})
+ assert %{"subscribing" => true} =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/accounts/#{followed.id}/follow", %{notify: "1"})
+ |> json_response_and_validate_schema(200)
- assert %{"id" => _id, "subscribing" => false} =
- json_response_and_validate_schema(ret_conn, 200)
+ assert %{"subscribing" => false} =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/accounts/#{followed.id}/follow", %{notify: false})
+ |> json_response_and_validate_schema(200)
end
test "following / unfollowing errors", %{user: user, conn: conn} do
diff --git a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
index 9a5d88109..0a9240b70 100644
--- a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
@@ -37,6 +37,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
end
end
+ @tag :skip_on_mac
test "search", %{conn: conn} do
user = insert(:user)
user_two = insert(:user, %{nickname: "shp@shitposter.club"})