aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/emoji.ex14
-rw-r--r--lib/pleroma/web/activity_pub/utils.ex3
-rw-r--r--lib/pleroma/web/common_api/common_api.ex17
3 files changed, 25 insertions, 9 deletions
diff --git a/lib/pleroma/emoji.ex b/lib/pleroma/emoji.ex
index 7d12eff7f..de7fcc1ce 100644
--- a/lib/pleroma/emoji.ex
+++ b/lib/pleroma/emoji.ex
@@ -97,10 +97,22 @@ defmodule Pleroma.Emoji do
# There was some other error
Logger.error("Could not access the custom emoji directory #{emoji_dir_path}: #{e}")
- {:ok, packs} ->
+ {:ok, results} ->
+ grouped = Enum.group_by(results, &File.dir?/1)
+ packs = grouped[true] || []
+ files = grouped[false] || []
+
# Print the packs we've found
Logger.info("Found emoji packs: #{Enum.join(packs, ", ")}")
+ if not Enum.empty?(files) do
+ Logger.warn(
+ "Found files in the emoji folder. These will be ignored, please move them to a subdirectory\nFound files: #{
+ Enum.join(files, ", ")
+ }"
+ )
+ end
+
emojis =
Enum.flat_map(
packs,
diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex
index b292d7d8d..faae7e747 100644
--- a/lib/pleroma/web/activity_pub/utils.ex
+++ b/lib/pleroma/web/activity_pub/utils.ex
@@ -794,10 +794,11 @@ defmodule Pleroma.Web.ActivityPub.Utils do
query =
from(
[activity, object: object] in Activity.with_preloaded_object(Activity),
+ where: fragment("(?)->>'type' = 'Create'", activity.data),
where: fragment("(?)->>'actor' = ?", activity.data, ^actor),
where:
fragment(
- "(?)->'inReplyTo' = ?",
+ "(?)->>'inReplyTo' = ?",
object.data,
^to_string(id)
),
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index 5212d5ce5..ad3c03c55 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -132,13 +132,16 @@ defmodule Pleroma.Web.CommonAPI do
Enum.map(choices, fn index ->
answer_data = make_answer_data(user, object, Enum.at(options, index)["name"])
- ActivityPub.create(%{
- to: answer_data["to"],
- actor: user,
- context: object.data["context"],
- object: answer_data,
- additional: %{"cc" => answer_data["cc"]}
- })
+ {:ok, activity} =
+ ActivityPub.create(%{
+ to: answer_data["to"],
+ actor: user,
+ context: object.data["context"],
+ object: answer_data,
+ additional: %{"cc" => answer_data["cc"]}
+ })
+
+ activity
end)
object = Object.get_cached_by_ap_id(object.data["id"])