Transmogrifier: Slices first character of hashtags when a leading # is missing
On @feld's instance there are objects like below, with plain-text elements in data.tag
being truncated versions of AS2 elements ("Juick" -> "uick", "XMPP" -> "MPP", "Jabber" -> "abber", "?" -> "", "2" -> "").
We had (or still have) code which truncated first symbol assuming that it's "#" — could it be the case here?
[
%Pleroma.Object{
__meta__: #Ecto.Schema.Metadata<:loaded, "objects">,
data: %{
"@context" => [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
%{"Hashtag" => "as:Hashtag"}
],
"actor" => "https://juick.com/u/CaufMAN",
"attributedTo" => "https://juick.com/u/CaufMAN",
"cc" => ["https://juick.com/u/CaufMAN/followers/toc"],
"content" => "<p>в общем, как я понял, меня жуйкобот то ли игнорирует, то ли выдает мне статус не в сети. При этом команды принимает, но ответа нет.<br/>\n<br/>\nЧто делать? Кто виноват?</p>\n<div class=\"msg-tags\"><a href=\"https://juick.com/tag/Juick\">#Juick</a>\n<a href=\"https://juick.com/tag/XMPP\">#XMPP</a>\n<a href=\"https://juick.com/tag/Jabber\">#Jabber</a>\n<a href=\"https://juick.com/tag/%3F\">#?</a>\n</div>\n",
"context" => "https://bikeshed.party/contexts/f84bd0ad-b5aa-40ff-972e-b4b3b173a697",
"context_id" => 6707638,
"conversation" => "https://bikeshed.party/contexts/f84bd0ad-b5aa-40ff-972e-b4b3b173a697",
"emoji" => %{},
"id" => "https://juick.com/n/2929343-0",
"published" => "2018-12-07T04:25:01Z",
"tag" => [
%{
"id" => "https://juick.com/t/Juick",
"name" => "Juick",
"type" => "Hashtag"
},
%{
"id" => "https://juick.com/t/XMPP",
"name" => "XMPP",
"type" => "Hashtag"
},
%{
"id" => "https://juick.com/t/Jabber",
"name" => "Jabber",
"type" => "Hashtag"
},
%{"id" => "https://juick.com/t/%3F", "name" => "?", "type" => "Hashtag"},
"uick",
"MPP",
"abber",
""
],
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
"type" => "Note",
"url" => "https://juick.com/m/2929343"
},
hashtags: #Ecto.Association.NotLoaded<association :hashtags is not loaded>,
id: 6707639,
inserted_at: ~N[2018-12-07 11:49:05],
updated_at: ~N[2019-12-18 05:42:14]
},
%Pleroma.Object{
__meta__: #Ecto.Schema.Metadata<:loaded, "objects">,
data: %{
"@context" => [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
%{
"Emoji" => "toot:Emoji",
"Hashtag" => "as:Hashtag",
"atomUri" => "ostatus:atomUri",
"conversation" => "ostatus:conversation",
"featured" => "toot:featured",
"focalPoint" => %{"@container" => "@list", "@id" => "toot:focalPoint"},
"inReplyToAtomUri" => "ostatus:inReplyToAtomUri",
"manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
"movedTo" => "as:movedTo",
"ostatus" => "http://ostatus.org#",
"sensitive" => "as:sensitive",
"toot" => "http://joinmastodon.org/ns#"
}
],
"actor" => "https://blog.funkwhale.audio/@/funkwhale/",
"announcement_count" => 1,
"announcements" => ["https://eldritch.cafe/users/fluffy"],
"attributedTo" => ["https://blog.funkwhale.audio/@/funkwhale/",
"https://blog.funkwhale.audio/~/Announcements/"],
"cc" => [],
"content" => "...",
"context" => "https://bikeshed.party/contexts/a1688c51-4546-443f-ace8-f1b9ddcbf2e1",
"context_id" => 6710457,
"conversation" => "https://bikeshed.party/contexts/a1688c51-4546-443f-ace8-f1b9ddcbf2e1",
"emoji" => %{},
"id" => "https://blog.funkwhale.audio/~/Announcements/logbook-week-1-2018-49/",
"name" => "Logbook, week 1 (2018-49)",
"published" => "2018-12-07T13:33:48.297869Z",
"repliesCount" => 0,
"source" => %{
"content" => "...",
"mediaType" => "text/markdown"
},
"summary" => "",
"tag" => [
%{
"href" => "https://blog.funkwhale.audio/tag/2",
"name" => "2",
"type" => "Hashtag"
},
""
],
"to" => ["https://mstdn.fr/users/BoF",
"https://blog.funkwhale.audio/@/funkwhale/",
"https://mastodon.host/users/bou",
"https://social.wiuwiu.de/users/placid",
"https://framapiaf.org/users/baardman",
"https://mastodon.technology/users/UnseatedAtreus",
"https://society.oftrolls.com/users/tbr",
"https://social.chilliet.eu/users/come", "https://ieji.de/users/Regy",
"https://bonn.social/users/Sascha",
"https://fosstodon.org/users/politicalcustard",
"https://pleroma.nethole.us/users/tmy", "https://mstdn.hu/users/dap78",
"https://mastodon.technology/users/renon",
"https://mastodon.social/users/pauho",
"https://mstdn.io/users/novaphoenix",
"https://mastodon.xyz/users/Fallstar",
"https://social.ttree.ch/users/dfeyer",
"https://social.hoga.fr/users/manu",
"https://meow.social/users/MadestMadness",
"https://mastodon.host/users/federationbot",
"https://fosstodon.org/users/jvalleroy",
"https://mastodon.social/users/noncommutativegeometry",
"https://artalley.porn/users/ultimatecoobie",
"https://occitanie.social/users/lou_pinfre",
"https://aleph.land/users/lagartojaen",
"https://mastodon.tetaneutral.net/users/roipoussiere", ...],
"type" => "Article",
"url" => "https://blog.funkwhale.audio/~/Announcements/logbook-week-1-2018-49/"
},
hashtags: #Ecto.Association.NotLoaded<association :hashtags is not loaded>,
id: 6710458,
inserted_at: ~N[2018-12-07 14:11:19],
updated_at: ~N[2019-12-18 05:42:14]
}
]
Edited by Haelwenn