Compare commits

...

3 commits

Author SHA1 Message Date
fd0cb148b9 bump version, 2.5.1
Some checks failed
ci/woodpecker/tag/lint Pipeline was successful
ci/woodpecker/tag/test Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/tag/release Pipeline was successful
ci/woodpecker/push/test Pipeline failed
2022-06-12 14:01:23 +01:00
a43859c8f4 update pleroma-fe
Some checks failed
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline failed
2022-06-12 14:00:52 +01:00
0f5bea2465 Add emoji_url to notifications to allow rendering
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
Ref #5
2022-06-12 13:35:14 +01:00
15 changed files with 70 additions and 12 deletions

View file

@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
## 2.5.0 - 10/06/2022
### Changed
- Allow users to remove their emails if instance does not need email to register
@ -21,6 +21,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Ability to log slow Ecto queries by configuring `:pleroma, :telemetry, :slow_queries_logging`
- Added Phoenix LiveDashboard at `/phoenix/live_dashboard`
- Added `/manifest.json` for progressive web apps.
- Readded mastoFE
- Added support for custom emoji reactions
- Added `emoji_url` in notifications to allow for custom emoji rendering
### Fixed
- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies

View file

@ -164,4 +164,22 @@ def maybe_quote(name) when is_binary(name) do
end
def maybe_quote(name), do: name
def emoji_url(%{"type" => "EmojiReact", "content" => emoji, "tag" => []}), do: nil
def emoji_url(%{"type" => "EmojiReact", "content" => emoji, "tag" => tags}) do
tag =
tags
|> Enum.find(fn tag -> tag["type"] == "Emoji" && tag["name"] == stripped_name(emoji) end)
if is_nil(tag) do
nil
else
tag
|> Map.get("icon")
|> Map.get("url")
end
end
def emoji_url(_), do: nil
end

View file

@ -138,7 +138,9 @@ defp put_report(response, activity) do
end
defp put_emoji(response, activity) do
Map.put(response, :emoji, activity.data["content"])
response
|> Map.put(:emoji, activity.data["content"])
|> Map.put(:emoji_url, Pleroma.Emoji.emoji_url(activity.data))
end
defp put_chat_message(response, activity, reading_user, opts) do

View file

@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do
def project do
[
app: :pleroma,
version: version("2.5.0"),
version: version("2.5.1"),
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),

View file

@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"><title>Pleroma</title><link rel=stylesheet href=/static/font/css/fontello.css><link rel=stylesheet href=/static/font/css/animation.css><link rel=stylesheet href=/static/font/tiresias.css><link rel=stylesheet href=/static/font/css/lato.css><!--server-generated-meta--><link rel=icon type=image/png href=/favicon.png><link href=/static/css/app.9065da1ae55149d987b6.css rel=stylesheet></head><body class=hidden><noscript>To use Pleroma, please enable JavaScript.</noscript><div id=app></div><script type=text/javascript src=/static/js/vendors~app.fac7e5e9d97125b642ef.js></script><script type=text/javascript src=/static/js/app.bfedff975f2109f6d66d.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"><title>Pleroma</title><link rel=stylesheet href=/static/font/css/fontello.css><link rel=stylesheet href=/static/font/css/animation.css><link rel=stylesheet href=/static/font/tiresias.css><link rel=stylesheet href=/static/font/css/lato.css><!--server-generated-meta--><link rel=icon type=image/png href=/favicon.png><link href=/static/css/app.ea8ec0bbcc083797019b.css rel=stylesheet></head><body class=hidden><noscript>To use Pleroma, please enable JavaScript.</noscript><div id=app></div><script type=text/javascript src=/static/js/vendors~app.fac7e5e9d97125b642ef.js></script><script type=text/javascript src=/static/js/app.699e9674d3b0bea12ca5.js></script></body></html>

File diff suppressed because one or more lines are too long

View file

@ -3487,6 +3487,13 @@ .Status .post-avatar.-compact {
height: 32px;
}
}
.reaction-emoji {
width: 40px;
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
}
.Notification {
border-bottom: 1px solid;
border-color: #222;
@ -6335,4 +6342,4 @@ .mrf-section table th + th, .mrf-section table td + td {
width: auto;
}
/*# sourceMappingURL=app.9065da1ae55149d987b6.css.map*/
/*# sourceMappingURL=app.ea8ec0bbcc083797019b.css.map*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -188,6 +188,34 @@ test "EmojiReact notification" do
pleroma: %{is_seen: false, is_muted: false},
type: "pleroma:emoji_reaction",
emoji: "",
emoji_url: nil,
account: AccountView.render("show.json", %{user: other_user, for: user}),
status: StatusView.render("show.json", %{activity: activity, for: user}),
created_at: Utils.to_masto_date(notification.inserted_at)
}
test_notifications_rendering([notification], user, [expected])
end
test "EmojiReact notification with custom emoji" do
user = insert(:user)
other_user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{status: "#morb"})
{:ok, _activity} = CommonAPI.react_with_emoji(activity.id, other_user, ":dinosaur:")
activity = Repo.get(Activity, activity.id)
[notification] = Notification.for_user(user)
assert notification
expected = %{
id: to_string(notification.id),
pleroma: %{is_seen: false, is_muted: false},
type: "pleroma:emoji_reaction",
emoji: ":dinosaur:",
emoji_url: "http://localhost:4001/emoji/dino walking.gif",
account: AccountView.render("show.json", %{user: other_user, for: user}),
status: StatusView.render("show.json", %{activity: activity, for: user}),
created_at: Utils.to_masto_date(notification.inserted_at)