mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 00:09:35 +00:00
Merge branch 'feature/twitterapi-object-description' into 'develop'
twitter api: provide object descriptions as attachment description field See merge request pleroma/pleroma!293
This commit is contained in:
commit
ffa552f1a4
|
@ -9,7 +9,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter do
|
||||||
url: url["href"] |> Pleroma.Web.MediaProxy.url(),
|
url: url["href"] |> Pleroma.Web.MediaProxy.url(),
|
||||||
mimetype: url["mediaType"] || url["mimeType"],
|
mimetype: url["mediaType"] || url["mimeType"],
|
||||||
id: data["uuid"],
|
id: data["uuid"],
|
||||||
oembed: false
|
oembed: false,
|
||||||
|
description: data["name"]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,7 +19,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter do
|
||||||
url: url |> Pleroma.Web.MediaProxy.url(),
|
url: url |> Pleroma.Web.MediaProxy.url(),
|
||||||
mimetype: data["mediaType"] || url["mimeType"],
|
mimetype: data["mediaType"] || url["mimeType"],
|
||||||
id: data["uuid"],
|
id: data["uuid"],
|
||||||
oembed: false
|
oembed: false,
|
||||||
|
description: data["name"]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ObjectReprenterTest do
|
||||||
id: 6,
|
id: 6,
|
||||||
url: "someurl",
|
url: "someurl",
|
||||||
mimetype: "sometype",
|
mimetype: "sometype",
|
||||||
oembed: false
|
oembed: false,
|
||||||
|
description: nil
|
||||||
}
|
}
|
||||||
|
|
||||||
assert expected_object == ObjectRepresenter.to_map(object)
|
assert expected_object == ObjectRepresenter.to_map(object)
|
||||||
|
@ -46,7 +47,8 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ObjectReprenterTest do
|
||||||
"http://mastodon.example.org/system/media_attachments/files/000/000/001/original/8619f31c6edec470.png",
|
"http://mastodon.example.org/system/media_attachments/files/000/000/001/original/8619f31c6edec470.png",
|
||||||
mimetype: "image/png",
|
mimetype: "image/png",
|
||||||
oembed: false,
|
oembed: false,
|
||||||
id: nil
|
id: nil,
|
||||||
|
description: "blabla"
|
||||||
}
|
}
|
||||||
|
|
||||||
assert expected_object == ObjectRepresenter.to_map(object)
|
assert expected_object == ObjectRepresenter.to_map(object)
|
||||||
|
|
Loading…
Reference in a new issue