diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c412ee44..894b8eb6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,50 @@ 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/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 4.0.0 (2023-12-05) + +### Breaking changes + +#### Release (binary package) installations + +- We now produce packages for different distributions targets (Debian Bookworm, Debian Bullseye, Ubuntu Jammy, Ubuntu Focal, Ubuntu Bionic, Fedora 38 and Fedora 39). Be sure to pick the right one for your system, as there can be issues with OpenSSL versions differing from inside the Mobilizon package and on your system. +- The `https://joinmobilizon.org/latest-package` URL now links to the latest package builded against Debian Bookworm. Make sure to follow the documentation if you're not using this. +- There's also an `arm64` package build on Debian Bullseye for now. + +#### Source installations + - Elixir 15 is now required + - The content of the `js` directory is now at the root of the repository, so you don't need to `cd js` anymore + - No need for `yarn` anymore, simply use `npm` instead for `npm i` and `npm run build` + +### New features + +- Event organizers and groups can be contacted through private messages (including PMs from 3rd-party micro-blogging fediverse services) +- Event organizers can send private announcements to event participants (approved or not) + + +### Improvements +- Anonymous participation e-mails now contain links to cancel your participation +- ActivityPub improvements for compatibility with https://event-federation.eu +- ICS export fixes for descriptions and adding event status + +### Changes since 4.0.0-rc.1 + +* refactor: to lower cyclomatic complexity ([147096c](https://framagit.org/framasoft/mobilizon/commits/147096c)) +* fix(activitypub): compact ical:status in activitystream data ([5e8f9af](https://framagit.org/framasoft/mobilizon/commits/5e8f9af)), closes [#1378](https://framagit.org/framasoft/mobilizon/issues/1378) +* fix(activitypub): fix receiving comments ([f1084c1](https://framagit.org/framasoft/mobilizon/commits/f1084c1)) +* fix(backend): handle ecto errors when fetching and create entities ([89d1ee4](https://framagit.org/framasoft/mobilizon/commits/89d1ee4)) +* fix(front): fix tag loading ([f81472e](https://framagit.org/framasoft/mobilizon/commits/f81472e)) +* fix(front): make recipient field placeholder translatable ([10ce812](https://framagit.org/framasoft/mobilizon/commits/10ce812)) +* fix(front): only show participants & announcements menu items to organizers ([c4d2ec6](https://framagit.org/framasoft/mobilizon/commits/c4d2ec6)) +* Translated using Weblate (Croatian) ([a26ff98](https://framagit.org/framasoft/mobilizon/commits/a26ff98)) +* Translated using Weblate (Croatian) ([1683f01](https://framagit.org/framasoft/mobilizon/commits/1683f01)) +* Translated using Weblate (Croatian) ([aa7f870](https://framagit.org/framasoft/mobilizon/commits/aa7f870)) +* Translated using Weblate (Croatian) ([1ce34ea](https://framagit.org/framasoft/mobilizon/commits/1ce34ea)) +* Translated using Weblate (Croatian) ([5e7edc0](https://framagit.org/framasoft/mobilizon/commits/5e7edc0)) +* Translated using Weblate (Croatian) ([d777d88](https://framagit.org/framasoft/mobilizon/commits/d777d88)) +* Translated using Weblate (Croatian) ([0118d97](https://framagit.org/framasoft/mobilizon/commits/0118d97)) +* Translated using Weblate (Croatian) ([805e931](https://framagit.org/framasoft/mobilizon/commits/805e931)) + ## 4.0.0-rc.1 (2023-12-04) * fix: prevent sending group physical address if it's empty and allow empty text for timezone ([32caebb](https://framagit.org/framasoft/mobilizon/commits/32caebb)), closes [#1357](https://framagit.org/framasoft/mobilizon/issues/1357) diff --git a/lib/federation/activity_pub/fetcher.ex b/lib/federation/activity_pub/fetcher.ex index 97166baa2..b017256db 100644 --- a/lib/federation/activity_pub/fetcher.ex +++ b/lib/federation/activity_pub/fetcher.ex @@ -42,28 +42,12 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do end @spec fetch_and_create(String.t(), Keyword.t()) :: - {:ok, map(), struct()} | {:error, atom()} | :error + {:ok, map(), struct()} | {:error, atom()} | {:error, Ecto.Changeset.t()} | :error def fetch_and_create(url, options \\ []) do case fetch(url, options) do {:ok, data} when is_map(data) -> if origin_check?(url, data) do - case Transmogrifier.handle_incoming(%{ - "type" => "Create", - "to" => data["to"], - "cc" => data["cc"], - "actor" => data["actor"] || data["attributedTo"], - "attributedTo" => data["attributedTo"] || data["actor"], - "object" => data - }) do - {:ok, entity, structure} -> - {:ok, entity, structure} - - {:error, error} when is_atom(error) -> - {:error, error} - - :error -> - {:error, :transmogrifier_error} - end + pass_to_transmogrifier(data) else Logger.warning("Object origin check failed") {:error, :object_origin_check_failed} @@ -98,6 +82,34 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do end end + @spec pass_to_transmogrifier(map()) :: + {:ok, map(), struct()} + | {:error, atom()} + | {:error, Ecto.Changeset.t()} + | {:error, :transmogrifier_error} + defp pass_to_transmogrifier(data) do + case Transmogrifier.handle_incoming(%{ + "type" => "Create", + "to" => data["to"], + "cc" => data["cc"], + "actor" => data["actor"] || data["attributedTo"], + "attributedTo" => data["attributedTo"] || data["actor"], + "object" => data + }) do + {:ok, entity, structure} -> + {:ok, entity, structure} + + {:error, error} when is_atom(error) -> + {:error, error} + + {:error, %Ecto.Changeset{} = err} -> + {:error, err} + + :error -> + {:error, :transmogrifier_error} + end + end + @type fetch_actor_errors :: :json_decode_error | :actor_deleted | :http_error | :actor_not_allowed_type diff --git a/lib/federation/activity_pub/transmogrifier.ex b/lib/federation/activity_pub/transmogrifier.ex index 2963deacd..4b64483b5 100644 --- a/lib/federation/activity_pub/transmogrifier.ex +++ b/lib/federation/activity_pub/transmogrifier.ex @@ -76,12 +76,10 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do Actions.Create.create(:conversation, object_data, false) object_data when is_map(object_data) -> - case Discussions.get_comment_from_url_with_preload(object_data.url) do - {:error, :comment_not_found} -> - object_data - |> transform_object_data_for_discussion() - |> save_comment_or_discussion() - end + handle_comment_or_discussion(object_data) + + {:error, err} -> + {:error, err} end {:ok, %Comment{} = comment} -> @@ -1019,6 +1017,19 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do is_nil(object_data.title) or object_data.title == "" end + defp handle_comment_or_discussion(object_data) do + case Discussions.get_comment_from_url_with_preload(object_data.url) do + {:error, :comment_not_found} -> + object_data + |> transform_object_data_for_discussion() + |> save_comment_or_discussion() + + {:ok, %Comment{} = comment} -> + # Object already exists + {:ok, nil, comment} + end + end + # Comment and conversations have different attributes for actor and groups @spec transform_object_data_for_discussion(map()) :: map() defp transform_object_data_for_discussion(object_data) do diff --git a/mix.exs b/mix.exs index aebe02bd2..63bf66fd6 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Mobilizon.Mixfile do use Mix.Project - @version "4.0.0-rc.1" + @version "4.0.0" def project do [ diff --git a/package.json b/package.json index 8f577cd27..717557895 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mobilizon", - "version": "4.0.0-rc.1", + "version": "4.0.0", "private": true, "scripts": { "dev": "vite", diff --git a/priv/gettext/hr/LC_MESSAGES/activity.po b/priv/gettext/hr/LC_MESSAGES/activity.po index 1f446c6fa..779659aeb 100644 --- a/priv/gettext/hr/LC_MESSAGES/activity.po +++ b/priv/gettext/hr/LC_MESSAGES/activity.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-25 07:55+0000\n" -"PO-Revision-Date: 2022-10-23 23:00+0000\n" +"PO-Revision-Date: 2023-12-04 18:10+0000\n" "Last-Translator: Milo Ivir \n" "Language-Team: Croatian \n" @@ -11,9 +11,9 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.14.1\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 5.2.1\n" ## This file is a PO Template file. ## @@ -486,73 +486,77 @@ msgstr "%{profile} su odobrili člana %{member}." #: lib/web/templates/email/activity/_event_activity_item.text.eex:31 #, elixir-autogen, elixir-format msgid "%{profile} joined your event %{event}." -msgstr "" +msgstr "%{profile} se pridružio/la tvom događaju %{event}." #: lib/web/views/email_view.ex:61 #, elixir-autogen, elixir-format msgid "An anonymous profile" -msgstr "" +msgstr "Anonimni profil" #: lib/web/templates/email/email_anonymous_activity.html.heex:107 #: lib/web/templates/email/email_anonymous_activity.text.eex:14 -#, elixir-autogen, elixir-format, fuzzy +#, elixir-autogen, elixir-format msgid "%{profile} has posted a private announcement about event %{event}." -msgstr "%{profile} su objavili najavu za događaj %{event}." +msgstr "%{profile} je objavio/la privatnu najavu za događaj %{event}." #: lib/web/templates/email/email_anonymous_activity.html.heex:50 #: lib/web/templates/email/email_anonymous_activity.text.eex:6 -#, elixir-autogen, elixir-format, fuzzy +#, elixir-autogen, elixir-format msgid "%{profile} has posted a public announcement under event %{event}." -msgstr "%{profile} su objavili najavu za događaj %{event}." +msgstr "%{profile} je objavio/la javnu najavu za događaj %{event}." #: lib/web/templates/email/activity/_conversation_activity_item.html.heex:3 -#, elixir-autogen, elixir-format, fuzzy +#, elixir-autogen, elixir-format msgid "%{profile} mentionned you in a %{conversation}." -msgstr "%{profile} su vas spomenuli u komentaru događaja %{event}." +msgstr "%{profile} te je spomenuo/la u konverzaciji %{conversation}." #: lib/web/templates/email/activity/_conversation_activity_item.text.eex:1 -#, elixir-autogen, elixir-format, fuzzy +#, elixir-autogen, elixir-format msgid "%{profile} mentionned you in a conversation." -msgstr "%{profile} su vas spomenuli u komentaru događaja %{event}." +msgstr "%{profile} te je spomenuo/la u jednoj konverzaciji." #: lib/service/activity/renderer/conversation.ex:36 #, elixir-autogen, elixir-format msgid "%{profile} replied to your message" -msgstr "" +msgstr "%{profile} je odgovorio/la na tvoju poruku" #: lib/web/templates/email/activity/_conversation_activity_item.html.heex:10 -#, elixir-autogen, elixir-format, fuzzy +#, elixir-autogen, elixir-format msgid "%{profile} replied you in a %{conversation}." -msgstr "%{profile} su odgovorili na razgovor %{discussion}." +msgstr "%{profile} ti je odgovorio/la u jednoj %{conversation}." #: lib/web/templates/email/activity/_conversation_activity_item.text.eex:6 #, elixir-autogen, elixir-format msgid "%{profile} replied you in a conversation." -msgstr "" +msgstr "%{profile} ti je odgovorio/la u jednoj konverzaciji." #: lib/service/activity/renderer/conversation.ex:49 #, elixir-autogen, elixir-format msgid "%{profile} sent a private message about event %{event}" -msgstr "" +msgstr "%{profile} je poslao/la privatnu poruku o događaju %{event}" #: lib/service/activity/renderer/conversation.ex:23 #, elixir-autogen, elixir-format msgid "%{profile} sent you a message" -msgstr "" +msgstr "%{profile} ti je poslao/la poruku" #: lib/web/email/activity.ex:52 #, elixir-autogen, elixir-format msgid "Informations about your event %{event}" -msgstr "" +msgstr "Informacije o tvom događaju %{event}" #: lib/web/templates/email/email_anonymous_activity.html.heex:118 #: lib/web/templates/email/email_anonymous_activity.text.eex:20 #, elixir-autogen, elixir-format msgid "It might give details on how to join the event, so make sure to read it appropriately." msgstr "" +"Može sadržavati pojedinosti o tome kako se pridružiti događaju, stoga ga " +"svakako pročitaj." #: lib/web/templates/email/email_anonymous_activity.html.heex:156 #: lib/web/templates/email/email_anonymous_activity.text.eex:28 #, elixir-autogen, elixir-format msgid "This information is sent privately to you as a person who registered for this event. Share the informations above with other people with caution." msgstr "" +"Ove informacije se šalju privatno tebi kao osobi koja se prijavila za ovaj " +"događaj. Dijeli gore navedene informacije s drugima s oprezom." diff --git a/priv/gettext/hr/LC_MESSAGES/default.po b/priv/gettext/hr/LC_MESSAGES/default.po index 34a5ceb1e..5975fd1eb 100644 --- a/priv/gettext/hr/LC_MESSAGES/default.po +++ b/priv/gettext/hr/LC_MESSAGES/default.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-25 07:56+0000\n" -"PO-Revision-Date: 2023-05-27 13:05+0000\n" +"PO-Revision-Date: 2023-12-04 18:10+0000\n" "Last-Translator: Milo Ivir \n" "Language-Team: Croatian \n" @@ -13,7 +13,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.17\n" +"X-Generator: Weblate 5.2.1\n" #: lib/web/templates/email/password_reset.html.heex:66 #, elixir-autogen, elixir-format @@ -1451,7 +1451,7 @@ msgstr "" #, elixir-autogen, elixir-format msgid "Your instance's moderation team has decided to suspend %{group_name} (%{group_address}). You are no longer a member of this group." msgstr "" -"Tim za moderiranje tvoje instance je odlučio suspendirati grupu " +"Tim za moderiranje tvoje instance je odlučio suspendiratigrupu " "%{group_name} (%{group_address}). Više nisi član ove grupe." #: lib/web/templates/email/actor_suspension_participants.html.heex:18 @@ -2105,9 +2105,9 @@ msgid "As this group was located on this instance, all of its data has been irre msgstr "" #: lib/web/templates/email/report.text.eex:11 -#, elixir-autogen, elixir-format, fuzzy +#, elixir-autogen, elixir-format msgid "Events" -msgstr "Događaj" +msgstr "Događaji" #: lib/web/templates/email/report.html.heex:115 #, elixir-autogen, elixir-format, fuzzy diff --git a/priv/gettext/hr/LC_MESSAGES/errors.po b/priv/gettext/hr/LC_MESSAGES/errors.po index f95b00f53..1b3a3eab1 100644 --- a/priv/gettext/hr/LC_MESSAGES/errors.po +++ b/priv/gettext/hr/LC_MESSAGES/errors.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-25 07:56+0000\n" -"PO-Revision-Date: 2023-04-11 18:20+0000\n" +"PO-Revision-Date: 2023-12-04 18:30+0000\n" "Last-Translator: Milo Ivir \n" "Language-Team: Croatian \n" @@ -13,7 +13,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.16.4\n" +"X-Generator: Weblate 5.2.1\n" ## This file is a PO Template file. ## @@ -1427,7 +1427,7 @@ msgstr "" #: lib/graphql/resolvers/conversation.ex:161 #, elixir-autogen, elixir-format msgid "Conversation needs to mention at least one participant that's not yourself" -msgstr "" +msgstr "Konverzacija treba spomenuti barem jednog sudionika koji nisi ti" #: lib/graphql/resolvers/participant.ex:396 #, elixir-autogen, elixir-format diff --git a/src/components/Event/EventActionSection.vue b/src/components/Event/EventActionSection.vue index f094f8b4a..46bfb8a87 100644 --- a/src/components/Event/EventActionSection.vue +++ b/src/components/Event/EventActionSection.vue @@ -107,11 +107,7 @@ {{ t("Actions") }} - + - + - +