diff --git a/js/src/mixins/group.ts b/js/src/mixins/group.ts index 1ff873f9c..26be0c3e2 100644 --- a/js/src/mixins/group.ts +++ b/js/src/mixins/group.ts @@ -5,7 +5,13 @@ import { } from "@/graphql/actor"; import { FETCH_GROUP } from "@/graphql/group"; import RouteName from "@/router/name"; -import { Group, IActor, IGroup, IPerson } from "@/types/actor"; +import { + Group, + IActor, + IGroup, + IPerson, + usernameWithDomain, +} from "@/types/actor"; import { MemberRole } from "@/types/enums"; import { Component, Vue } from "vue-property-decorator"; @@ -34,7 +40,7 @@ import { Component, Vue } from "vue-property-decorator"; variables() { return { id: this.currentActor.id, - group: this.group.preferredUsername, + group: usernameWithDomain(this.group), }; }, subscribeToMore: { diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index f67ba5dc2..3d098bfb3 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -859,9 +859,12 @@ export default class EditEvent extends Vue { */ private async buildVariables() { let res = this.event.toEditJSON(); - if (this.event.organizerActor) { + const organizerActor = this.event.organizerActor?.id + ? this.event.organizerActor + : this.organizerActor; + if (organizerActor) { res = Object.assign(res, { - organizerActorId: this.event.organizerActor.id, + organizerActorId: organizerActor.id, }); } const attributedToId = this.event.attributedTo?.id diff --git a/js/src/views/Group/Group.vue b/js/src/views/Group/Group.vue index a1f64a3c1..0d3d52801 100644 --- a/js/src/views/Group/Group.vue +++ b/js/src/views/Group/Group.vue @@ -79,6 +79,49 @@ }" >{{ $t("Group settings") }} + + + + + + {{ $t("Report") }} + + + + + + + {{ $t("RSS/Atom Feed") }} + + + + + + {{ $t("ICS/WebCal Feed") }} + + + + @@ -456,19 +499,19 @@ /> - - - + + + diff --git a/js/src/views/Group/GroupFollowers.vue b/js/src/views/Group/GroupFollowers.vue index 069e98da2..0b1451202 100644 --- a/js/src/views/Group/GroupFollowers.vue +++ b/js/src/views/Group/GroupFollowers.vue @@ -171,7 +171,7 @@ export default class GroupFollowers extends mixins(GroupMixin) { pending: boolean | null = (this.$route.query.pending as string) == "1" || null; - FOLLOWERS_PER_PAGE = 1; + FOLLOWERS_PER_PAGE = 10; usernameWithDomain = usernameWithDomain; diff --git a/js/src/views/Settings/Preferences.vue b/js/src/views/Settings/Preferences.vue index 822554d51..29ae92299 100644 --- a/js/src/views/Settings/Preferences.vue +++ b/js/src/views/Settings/Preferences.vue @@ -257,6 +257,7 @@ export default class Preferences extends Vue { await this.$apollo.mutate<{ setUserSetting: string }>({ mutation: SET_USER_SETTINGS, variables: userSettings, + refetchQueries: [{ query: USER_SETTINGS }], }); } } diff --git a/lib/federation/activity_pub/types/actors.ex b/lib/federation/activity_pub/types/actors.ex index e02ddffab..e0ac6d594 100644 --- a/lib/federation/activity_pub/types/actors.ex +++ b/lib/federation/activity_pub/types/actors.ex @@ -3,7 +3,7 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Actors do alias Mobilizon.Actors alias Mobilizon.Actors.{Actor, Follower, Member} alias Mobilizon.Federation.ActivityPub - alias Mobilizon.Federation.ActivityPub.Audience + alias Mobilizon.Federation.ActivityPub.{Audience, Relay} alias Mobilizon.Federation.ActivityPub.Types.Entity alias Mobilizon.Federation.ActivityStream.Convertible alias Mobilizon.GraphQL.API.Utils, as: APIUtils @@ -223,7 +223,10 @@ defmodule Mobilizon.Federation.ActivityPub.Types.Actors do %Follower{} = follower, follow_as_data ) do - unless follower.target_actor.manually_approves_followers do + %Actor{id: relay_id} = Relay.get_actor() + + unless follower.target_actor.manually_approves_followers or + follower.target_actor.id == relay_id do {:accept, ActivityPub.accept( :follow, diff --git a/lib/service/export/common.ex b/lib/service/export/common.ex index 2b9a35692..dd3e53903 100644 --- a/lib/service/export/common.ex +++ b/lib/service/export/common.ex @@ -11,7 +11,7 @@ defmodule Mobilizon.Service.Export.Common do @spec fetch_actor_event_feed(String.t()) :: String.t() def fetch_actor_event_feed(name) do - with %Actor{} = actor <- Actors.get_local_actor_by_name(name), + with %Actor{} = actor <- Actors.get_actor_by_name(name), {:visibility, true} <- {:visibility, Actor.is_public_visibility?(actor)}, %Page{elements: events} <- Events.list_public_events_for_actor(actor), %Page{elements: posts} <- Posts.get_public_posts_for_group(actor) do diff --git a/lib/service/formatter/html.ex b/lib/service/formatter/html.ex index ef4cdd6a4..2e8bd5ee5 100644 --- a/lib/service/formatter/html.ex +++ b/lib/service/formatter/html.ex @@ -17,7 +17,7 @@ defmodule Mobilizon.Service.Formatter.HTML do def strip_tags(html) do case FastSanitize.strip_tags(html) do {:ok, html} -> - html + HtmlEntities.decode(html) _ -> raise "Failed to filter tags" diff --git a/lib/web/controllers/feed_controller.ex b/lib/web/controllers/feed_controller.ex index 4de8e61b4..4db698fea 100644 --- a/lib/web/controllers/feed_controller.ex +++ b/lib/web/controllers/feed_controller.ex @@ -7,9 +7,7 @@ defmodule Mobilizon.Web.FeedController do action_fallback(Mobilizon.Web.FallbackController) alias Mobilizon.Config - @formats ["ics", "atom"] - - def instance(conn, %{"format" => format}) when format in @formats do + def instance(conn, %{"format" => format}) do if Config.get([:instance, :enable_instance_feeds], false) do return_data(conn, format, "instance", Config.instance_name()) else @@ -17,7 +15,7 @@ defmodule Mobilizon.Web.FeedController do end end - def actor(conn, %{"format" => format, "name" => name}) when format in @formats do + def actor(conn, %{"format" => format, "name" => name}) do return_data(conn, format, "actor_" <> name, name) end @@ -33,7 +31,7 @@ defmodule Mobilizon.Web.FeedController do {:error, :not_found} end - def going(conn, %{"token" => token, "format" => format}) when format in @formats do + def going(conn, %{"token" => token, "format" => format}) do return_data(conn, format, "token_" <> token, "events") end @@ -72,4 +70,8 @@ defmodule Mobilizon.Web.FeedController do {:error, :not_found} end end + + defp return_data(_conn, _, _, _) do + {:error, :not_found} + end end diff --git a/mix.exs b/mix.exs index fec5fc81b..beb5d9901 100644 --- a/mix.exs +++ b/mix.exs @@ -142,6 +142,7 @@ defmodule Mobilizon.Mixfile do {:ex_cldr_languages, "~> 0.2.1"}, {:slugger, "~> 0.3"}, {:sentry, "~> 8.0"}, + {:html_entities, "~> 0.5"}, # Dev and test dependencies {:phoenix_live_reload, "~> 1.2", only: [:dev, :e2e]}, {:ex_machina, "~> 2.3", only: [:dev, :test]}, diff --git a/test/service/metadata/utils_test.exs b/test/service/metadata/utils_test.exs index 9ba6742ae..9aa1dcc8b 100644 --- a/test/service/metadata/utils_test.exs +++ b/test/service/metadata/utils_test.exs @@ -17,7 +17,7 @@ defmodule Mobilizon.Service.Metadata.UtilsTest do "

Biography

It all started when someone wanted a very long string to be cut. However it's difficult to invent things to write when you've got nothing to say. Anyway, what's the deal here. We just need to reach 200 characters.", "fr" ) == - "Biography It all started when someone wanted a very long string to be cut. However it's difficult to invent things to write when you've got nothing to say. Anyway, what's the deal here. We…" + "Biography It all started when someone wanted a very long string to be cut. However it's difficult to invent things to write when you've got nothing to say. Anyway, what's the deal here. We just need to…" end test "process_description/3 returns default if no description is provided" do