diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-08-11 21:29:06 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-08-11 21:38:10 +0200 |
commit | 61d233921cf1a5f45ade58cb562e9ffdacc291e8 (patch) | |
tree | fc9d1e3cf5de7cbe83ee90beae794244610252fc /lib/pleroma/web/push/impl.ex | |
parent | 7c1243178b44d629f6881aa1b197641d56bbd0f1 (diff) | |
download | pleroma-61d233921cf1a5f45ade58cb562e9ffdacc291e8.tar.gz |
ObjectValidator.stringify_keys: filter out nil values
Diffstat (limited to 'lib/pleroma/web/push/impl.ex')
-rw-r--r-- | lib/pleroma/web/push/impl.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex index 83cbdc870..28e13ef9c 100644 --- a/lib/pleroma/web/push/impl.ex +++ b/lib/pleroma/web/push/impl.ex @@ -124,8 +124,8 @@ defmodule Pleroma.Web.Push.Impl do def format_body(activity, actor, object, mastodon_type \\ nil) - def format_body(_activity, actor, %{data: %{"type" => "ChatMessage", "content" => content}}, _) do - case content do + def format_body(_activity, actor, %{data: %{"type" => "ChatMessage"} = data}, _) do + case data["content"] do nil -> "@#{actor.nickname}: (Attachment)" content -> "@#{actor.nickname}: #{Utils.scrub_html_and_truncate(content, 80)}" end |