logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: dc26f749617dda6ed2b538f515056567519d9246
parent 7ddae61414a2e0f04560d2afe46dc51c5ac32c85
Author: Phantasm <phantasm@centrum.cz>
Date:   Wed,  4 Jun 2025 18:32:25 +0200

Revert to previous tag_validator behavior

This paritally reverts commit 9710063fdc92ca3df9005ef57f678fd78680a4f0
and reverts commit 7ddae61414a2e0f04560d2afe46dc51c5ac32c85

See thread: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4358#note_112761

Diffstat:

Mlib/pleroma/web/activity_pub/object_validators/tag_validator.ex8+-------
Mtest/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs2+-
2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex b/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex @@ -50,13 +50,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do end def changeset(struct, %{"type" => "Hashtag", "name" => name} = data) do - name = - case name do - "#" <> name -> name - name -> name - end - |> String.downcase() - + name = String.downcase(name) data = Map.put(data, "name", name) struct diff --git a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs @@ -200,7 +200,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do assert match?( %{ "href" => "http://mastodon.example.org/tags/moo", - "name" => "moo", + "name" => "#moo", "type" => "Hashtag" }, Enum.at(object.data["tag"], 1)