add guards around fix misskey content
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
This commit is contained in:
parent
405406601f
commit
bf3f934275
1 changed files with 3 additions and 2 deletions
|
@ -110,7 +110,8 @@ defp remote_mention_resolver(
|
||||||
# https://github.com/misskey-dev/misskey/pull/8787
|
# https://github.com/misskey-dev/misskey/pull/8787
|
||||||
defp fix_misskey_content(
|
defp fix_misskey_content(
|
||||||
%{"source" => %{"mediaType" => "text/x.misskeymarkdown", "content" => content}} = object
|
%{"source" => %{"mediaType" => "text/x.misskeymarkdown", "content" => content}} = object
|
||||||
) do
|
)
|
||||||
|
when is_binary(content) do
|
||||||
mention_handler = fn nick, buffer, opts, acc ->
|
mention_handler = fn nick, buffer, opts, acc ->
|
||||||
remote_mention_resolver(object, nick, buffer, opts, acc)
|
remote_mention_resolver(object, nick, buffer, opts, acc)
|
||||||
end
|
end
|
||||||
|
@ -121,7 +122,7 @@ defp fix_misskey_content(
|
||||||
Map.put(object, "content", linked)
|
Map.put(object, "content", linked)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp fix_misskey_content(%{"_misskey_content" => content} = object) do
|
defp fix_misskey_content(%{"_misskey_content" => content} = object) when is_binary(content) do
|
||||||
mention_handler = fn nick, buffer, opts, acc ->
|
mention_handler = fn nick, buffer, opts, acc ->
|
||||||
remote_mention_resolver(object, nick, buffer, opts, acc)
|
remote_mention_resolver(object, nick, buffer, opts, acc)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue