X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fpush%2Fimpl.ex;h=28e13ef9c791cbfe16e4737099572cfa898cd786;hb=87871ac85722b0cec067decf698bf02fbf36dc93;hp=f91cb1d40718eabcebbceb57139935dcc30a2511;hpb=3ce11b830ee69d8557146fce6d3507337298259d;p=akkoma
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex
index f91cb1d40..28e13ef9c 100644
--- a/lib/pleroma/web/push/impl.ex
+++ b/lib/pleroma/web/push/impl.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Push.Impl do
@@ -32,7 +32,7 @@ defmodule Pleroma.Web.Push.Impl do
mastodon_type = notification.type
gcm_api_key = Application.get_env(:web_push_encryption, :gcm_api_key)
avatar_url = User.avatar_url(actor)
- object = Object.normalize(activity, false)
+ object = Object.normalize(activity, fetch: false)
user = User.get_cached_by_id(user_id)
direct_conversation_id = Activity.direct_conversation_id(activity, user)
@@ -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
@@ -155,7 +155,7 @@ defmodule Pleroma.Web.Push.Impl do
_object,
_mastodon_type
) do
- "@#{actor.nickname} has reacted with #{content}"
+ "@#{actor.nickname} reacted with #{content}"
end
def format_body(