projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
79668c0
)
use `User.avatar_url`
author
Egor Kislitsyn
<egor@kislitsyn.com>
Thu, 6 Dec 2018 13:55:46 +0000
(20:55 +0700)
committer
Egor Kislitsyn
<egor@kislitsyn.com>
Thu, 6 Dec 2018 13:55:46 +0000
(20:55 +0700)
lib/pleroma/web/push/push.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/push/push.ex
b/lib/pleroma/web/push/push.ex
index 4e9bc5741f1a2649a28f9b9fe92a7d9b3b39a2d6..5a873ec19cf3231c4079ef731e71c7525ce983b9 100644
(file)
--- a/
lib/pleroma/web/push/push.ex
+++ b/
lib/pleroma/web/push/push.ex
@@
-68,7
+68,7
@@
defmodule Pleroma.Web.Push do
Logger.error("Web Push Nonification failed with code: #{code}")
:error
Logger.error("Web Push Nonification failed with code: #{code}")
:error
-
data
->
+
_
->
Logger.error("Web Push Nonification failed with unknown error")
:error
end
Logger.error("Web Push Nonification failed with unknown error")
:error
end
@@
-86,7
+86,7
@@
defmodule Pleroma.Web.Push do
%{
title: "New Mention",
body: "@#{actor.nickname} has mentiond you",
%{
title: "New Mention",
body: "@#{actor.nickname} has mentiond you",
- icon:
get_
avatar_url(actor)
+ icon:
User.
avatar_url(actor)
}
end
}
end
@@
-94,7
+94,7
@@
defmodule Pleroma.Web.Push do
%{
title: "New Follower",
body: "@#{actor.nickname} has followed you",
%{
title: "New Follower",
body: "@#{actor.nickname} has followed you",
- icon:
get_
avatar_url(actor)
+ icon:
User.
avatar_url(actor)
}
end
}
end
@@
-102,7
+102,7
@@
defmodule Pleroma.Web.Push do
%{
title: "New Announce",
body: "@#{actor.nickname} has announced your post",
%{
title: "New Announce",
body: "@#{actor.nickname} has announced your post",
- icon:
get_
avatar_url(actor)
+ icon:
User.
avatar_url(actor)
}
end
}
end
@@
-110,18
+110,7
@@
defmodule Pleroma.Web.Push do
%{
title: "New Like",
body: "@#{actor.nickname} has liked your post",
%{
title: "New Like",
body: "@#{actor.nickname} has liked your post",
- icon:
get_
avatar_url(actor)
+ icon:
User.
avatar_url(actor)
}
end
}
end
-
- def get_avatar_url(%{avatar: %{"type" => "Image", "url" => urls}}) do
- case List.first(urls) do
- %{"href" => url} -> url
- _ -> get_avatar_url(nil)
- end
- end
-
- def get_avatar_url(_) do
- Pleroma.Web.Endpoint.static_url() <> "/images/avi.png"
- end
end
end